Tuesday, 20 August 2013

In knockout.js, .attr('href',url') is not working why?

In knockout.js, .attr('href',url') is not working why?

In my mobile application, using knockout js for all process in my webpage
and its working fine. But I'm unable to use .attr('href',url') for going
opening one div and hide another div.
<a data-role="button" data-direction="reverse" data-transition="slide"
href="#" id="btnSearch" data-icon="arrow-l" data-iconpos="left"
class="ui-btn-left" data-bind="click: clearValue">
Click
</a>
self.clearValue = function () {
$("#txtFirstName").val("");
$("#txtLastName").val("");
$("#txtEmail").val("");
$("#txtMobileNumber").val("");
$("#btnSearch").attr('href', '#page2'); //Page2 is div tag
};
After click this above link, it should clear some textbox values
successfully but it doesn't open DIV (page2). Because this is a single
page application
Suppose If i give like this location.href = "#page2". It opened that page
but slide effect is missing. because this is mobile application so i need
that sliding effect also.
I don't know where I made mistake? Please help me friends

No comments:

Post a Comment