Hi ,
I have created simple app which is having login page username & password . and also i have api which return id,name as json format.
one more thing day before yesterday same was working properly. but wen i tried today its not working.
every time it is error function is executing.
please help me sovle this problem, here is my code as follow
login:
<div data-role="view" data-title="Home View" data-layout="main" data-model="app.home" data-show="app.home.onShow" data-after-show="app.home.afterShow">
<div class="signin-view">
<form>
<ul data-role="listview" data-style="inset">
<li>
<label>Email
<input type="email" id="email" required autofocus>
</label>
</li>
<li>
<label>Password
<input type="password" id="password" required>
</label>
</li>
</ul>
<div class="button-group button-group-vertical">
<a class="primary" data-role="button" id="btnlogin">click</a>
</div>
</form>
</div>
</form>
</div>
<div class="offline" align="center" style="display:none;">
You are currently offline. Before using this app in offline mode you must initialize it while you are online
</div>
<!-- START_CUSTOM_CODE_homeModel -->
<!-- Add custom code here. For more information about custom code, see http://docs.telerik.com/platform/screenbuilder/troubleshooting/how-to-keep-custom-code-changes -->
<!-- END_CUSTOM_CODE_homeModel -->
<!-- START_CUSTOM_CODE_home -->
<!-- Add custom code here. For more information about custom code, see http://docs.telerik.com/platform/screenbuilder/troubleshooting/how-to-keep-custom-code-changes -->
<!-- END_CUSTOM_CODE_home -->
<script type="text/javascript">
$('#btnlogin').click(function () {
var username = $('#email').val();
var password = $('#password').val();
alert(email+","+password);
$.ajax({
url: "http://www.mivbvpn.com:8040/api/users?",
data: {
Username: username,
Password: password
},
type: "get",
dataType: "json",
success: function (data) {
alert("data:");
},
error: function (xhr, data) {
alert(xhr.statusText);
}
});
});
</script>
</div>