【发布时间】:2012-02-12 18:27:26
【问题描述】:
我正在使用 simpledialog 库 (http://dev.jtsage.com/jQM-SimpleDialog/) 并包含所有必要的 JS 和 CSS 文件,但是我无法显示弹出窗口。我究竟做错了什么?我没有看到弹出窗口。
$.ajax({
type: "post",
url: url,
data: $("#login").serialize(),
dataType: 'json',
success: function (msg) {
var message = msg.message;
if (message.type == "Success") {
window.location.replace("reminder_list.html");
} else if (message.type == "Error") {
alert("login error"); //THIS SHOWS
$(this).simpledialog({ //THIS DOES NOT SHOW
'mode': 'bool',
'prompt': 'Login Failed: ' + message.content,
'buttons': {
'OK': {
click: function () {
$('#dialogoutput').text('OK');
}
}
}
})
}
【问题讨论】:
-
我们需要更多细节,请发布html
-
这段代码附加到什么事件和元素上?
-
我已经更新了我的代码以显示它在 ajax 调用的成功处理程序中被调用。
标签: javascript jquery jquery-mobile dialog