这是我的代码:
string script = "GoNext()";
ScriptManager.RegisterClientScriptBlock(this, GetType(), "next", script, true);
客户方:
$(document).ready(function () {
function GoNext() {
$("#wizard").scrollable().next();
}
});
我收到一个控制台错误,说GoNext未定义
答案 0 :(得分:3)
不要将函数放在$(document).ready(function () {
块中,因为它的作用域在ready
块内,并且在全局范围内不可用。
function GoNext() {
$("#wizard").scrollable().next();
}