在Safari中运行和调试对我来说是全新的。
我有一个登录页面,适用于除Safari之外的所有浏览器。
我设法为此浏览器找到了Web Inspector,它给了我这个错误:
无法找到变量:$
现在,我不知道从哪里开始。
这是我需要了解的Safari和Jquery之间的兼容性吗?
这些是我在母版页中的包含(我使用的是asp.net)
<script type="application/javascript" src="http://myurl/Scripts/json2.js"></script>
<script type="application/javascript" src="http://myurl/Scripts/jquery-2.0.3.js"></script>
<script type="application/javascript" src="http://myurl/Scripts/jquery-ui-1.10.3.custom.min.js"></script>
<script type="application/javascript" src="../Scripts/jquery-ui-1.10.3.custom.js"></script>
<link rel="stylesheet" href="../Styles/jquery-ui.css" />
<script type="application/javascript" src="../Scripts/jquery.animate-shadow-min.js"></script>
<script type="application/javascript" src="../Scripts/jquery.animate-shadow.js"></script>
这是我的主叫代码:
<script type="text/javascript">
function LogIn() {
var _username = document.getElementById('<%=txtUsername.ClientID%>');
var _password = document.getElementById('<%=txtPassword.ClientID%>');
if (_username.value != '' && _password.value != '') {
jQuery(function ($) {
$("#lblLoginError").html('Logging you in...');
btnLogIn.enabled = false;
btnForgotPassword.enabled = false;
$.ajax({
type: "POST",
url: "LogIn.aspx/Login",
data: JSON.stringify({
Username: _username.value,
Password: _password.value
}),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d == 'OK') {
document.location.href = 'Manager.aspx';
}
else {
$("#lblLoginError").html(msg.d);
btnLogIn.enabled = true;
}
},
error: function (msg) {
$("#lblLoginError").html('Server Error');
btnLogIn.enabled = true;
}
});
});
}
else {
$("#lblLoginError").html('Both Username and Password must be supplied.');
}
}
</script>
请告诉我?
由于