jquery对话框中的Html代码

时间:2011-07-18 23:55:12

标签: jquery html

如何将分离的HTML文件中的HTML代码加载到另一个文件中的对话框中。 当我在one.html页面中单击锚点时,会出现包含HTML代码的对话框。

我没有将对话框中出现的代码放在同一页面中,因为我会将此代码用于其他地方。

1 个答案:

答案 0 :(得分:1)

您可以使用ajax

阅读您的代码
jQuery.get('second.html', function(html){
    $('#dialog').html(html).dialog();
})

这应该可以使用jQuery和jQuery UI for dialog

希望这有帮助