如何将分离的HTML文件中的HTML代码加载到另一个文件中的对话框中。 当我在one.html页面中单击锚点时,会出现包含HTML代码的对话框。
我没有将对话框中出现的代码放在同一页面中,因为我会将此代码用于其他地方。
答案 0 :(得分:1)
您可以使用ajax
阅读您的代码jQuery.get('second.html', function(html){
$('#dialog').html(html).dialog();
})
这应该可以使用jQuery和jQuery UI for dialog
希望这有帮助