你如何在对话框的JQUERY UI中打开一个URL [英] How do you open a URL in a dialog box JQUERY UI

查看:93
本文介绍了你如何在对话框的JQUERY UI中打开一个URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个简单的解决方案很长一段时间。我想要在JQuery UI对话框中显示一个页面(例如 http://www.google.com )窗口。该计划将在以后动态添加该URL,以便从我的网站的所有链接都将显示在上述窗口中。



我尝试了以下操作,但点击链接时对话窗口是空的。

 <!DOCTYPE html PUBLIC -  // W3C // DTD HTML 4.01 Transitional // ENhttp://www.w3.org/TR/html4/loose.dtd\"> 
< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = ISO-8859-1>
< title>测试< /标题>


< meta charset =utf-8/>
< link rel =stylesheethref =http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css/>
< script src =http://code.jquery.com/jquery-1.9.1.js>< / script>
< script src =http://code.jquery.com/ui/1.10.1/jquery-ui.js>< / script>
< script>
$(document).ready(function(){
$('#openwindow')。each(function(){
var $ link = $(this);
var $ dialog = $('< div>< / div>')
.load($ link.attr('href'))
.dialog({
autoOpen:false ,
title:$ link.attr('title'),
width:500,
height:300
});

$链接。 click(function(){
$ dialog.dialog('open');

return false;
});
});
} );
< / script>

< / head>
< body>
< a id =openwindowhref =http://www.google.com>点击我进行测试。< / a>
< / body>
< / html>

我找到了几个例子,但没有一个真正起作用。我非常感谢您的帮助。



预先致谢。

解决方案

您不需要