I am using jQuery mobile in my project and when I log on to system, then go to change password page, the change action is not firing (no action). But, when I refresh the page, it is firing. Briefly, the button on the page is not working when it is redirected from another page except itself. I have imported .css and .js files correctly in master page. (Generic Handler returns correct values and it is working)
head content:
<script type="text/javascript">
$(document).ready(function () {
$("#changePasswordBtn").click(function () {
$.ajax({
type: "POST",
url: "ChangePasswordHandler.ashx",
data: "oldPassword=" + $("#oldPassword").val() + "&newPassword=" + $("#newPassword").val() + "&reNewPassword=" + $("#reNewPassword").val(),
success: function (msg) {
if (msg == 0) $("#popupText").text("success");
else if (msg == 1) $("#popupText").text("wrong pass");
else if (msg == 2) $("#popupText").text("match error");
else if (msg == 3) $("#popupText").text("fill boxes");
else $("#popupText").text("error");
}
});
})
});
</script>
body content:
<input type="button" id="changePasswordBtn" value="Change Password" data-inline="true" />