3

我希望在发生错误时出现一个对话框,但是我不知道该怎么做。我希望代码出现在下面的代码中。因此,当调用此函数时,会出现一个弹出对话框。

.fail(function(){ alert("$.get failed!"); //replace with failed dialog }) });

4

1 回答 1

8

所以我猜这就是你所说的。

http://api.jquerymobile.com/popup/

将此嵌入到您的 html 中的某个地方。

 <div data-role="popup" id="popupCloseLeft" class="ui-content" style="max-width:280px">
 <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-left">Close</a>
 <p>I have a close button at the top left corner with simple HTML markup.</p>
 </div>

然后在你的失败函数中调用它。

$( "#popupCloseLeft" ).popup("open");
于 2013-03-19T18:33:07.457 回答