How do you open a URL in a dialog box JQUERY UI

前端 未结 4 1454
情书的邮戳
情书的邮戳 2020-12-17 00:52

I\'ve been looking for a simple solution for quite some time. I want a page (for example http://www.google.com) to be displayed in a JQuery UI Dialog window. The plan is to

4条回答
  •  天涯浪人
    2020-12-17 00:55

    You don't need an iframe as has been suggested, but you should read the documentation on dialogs here.

    Instead, you need to load the content on the .open property --

    $( "#openwindow" ).dialog({
     open: function(event, ui) {
       $('#divInDialog').load('test.html', function() {
         alert('Load was performed.');
       });
      }
    });
    

    Also, you seem to use .each with an id -- the id is supposed to be unique within the page. use class instead.

提交回复
热议问题