我正在尝试使用来自ajax帖子的回调函数的JQuery移动弹出窗口。我的回调函数有一个名为"msg“的数据,它是一个字符串,通常写着"Save Succesful”。有没有什么例子可以让我打开和关闭带有该消息的弹出窗口或对话框?这是我到目前为止所知道的:
$.post('/Home/SaveSomething', { data: someData },
function (msg) {
//OPEN THE DIALOG
});谢谢。
发布于 2012-10-13 13:53:09
$.post('/Home/SaveSomething',
{ data: someData },
function (msg) {
//OPEN THE DIALOG
// you can use alert
alert(msg);
// or for custom popup need to use css and jquery coding
});发布于 2012-10-13 14:25:10
你可以试试这个
<div data-role="popup" id="popup-message" data-theme="a" data-overlay-theme="a" class="ui-content">
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="remove" data-iconpos="notext" class="ui-btn-right">Close</a>
</div>如上为消息创建一个空的弹出容器,并使用容器的id填充来自ajax成功函数的数据,如下所示
$.post('/Home/SaveSomething', { data: someData },
function (msg) {
$('#popup-message').text(msg); //fill the data here
$('#popup-message').popup("open"); // open the popup
});https://stackoverflow.com/questions/12870353
复制相似问题