admin管理员组

文章数量:1291031

I want a dialog box to appear when an error occurs however I dont know how to do it. Where I would like the code to appear can be seen in the code below. So when this function is called a popup dialog box appears.

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

I want a dialog box to appear when an error occurs however I dont know how to do it. Where I would like the code to appear can be seen in the code below. So when this function is called a popup dialog box appears.

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

Share Improve this question asked Mar 19, 2013 at 18:24 Kern ElliottKern Elliott 1,6595 gold badges41 silver badges67 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

So I'm guessing this is what you are talking about.

http://api.jquerymobile./popup/

Have this embedded in your html somewhere.

 <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>

And then in your fail function just call this.

$( "#popupCloseLeft" ).popup("open");

本文标签: javascriptCreating a popup dialog when an error occurs Jquery MobileStack Overflow