嗨,这里又是同样的问题 js 错误函数未定义(onForgotPasswordClick 未定义),我不知道它现在在简单的普通页面上(没有母版页),请帮助
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0-rc.1/jquery.mobile-1.3.0-rc.1.min.css" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0-rc.1/jquery.mobile-1.3.0-rc.1.min.js"> </script>
<link href="Scripts/Style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$("#main-page").on('pageinit', function (event) {
function onForgotPasswordClick() {
WebApplication.Services.ForgetPassword.HelloWorld(onMethodSucceeded, onMethodFailed);
}
function onMethodSucceeded(results, args) {
alert(results);
}
function onMethodFailed(error) {
}
});
</script>
</head>
<body>
<form id="Form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server">
<Services>
<asp:ServiceReference Path="~/ForgetPassword.asmx" />
</Services>
</asp:ScriptManager>
<div data-role="page" id="main-page">
<div data-role="header" data-theme="b">
<a href="/" class="ui-btn-right">Cancel</a> <h1>
Forgot Password</h1>
</div>
<div data-role="content" >
<fieldset data-role="fieldcontain" class="ui-hide-label" >
<legend>
Username:</legend>
<input type="text" name="txtUsername" id="txtUsername" value="" placeholder="Username" />
<legend>
Email:</legend>
<input type="email" name="txtemail" id="txtemail" value="" placeholder="Email" />
<button type="submit" id="btnLogin" data-theme="b" onclick="onForgotPasswordClick()">
Submit</button>
<hr />
</fieldset>
<div style="display:none" id="msg">
</div>
</div>
<div data-role="footer" data-theme="b">
<h4>© 2013 All rights reserved.</h4>
</div>
</div>
</form>
</body>
</html>
这是类似的帖子... microsoft jscript runtime error:test is undefined 谢谢