Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用html在弹出对话框中添加iframe元素标记_Javascript_Jquery_Html_Css_Iframe - Fatal编程技术网

Javascript 如何使用html在弹出对话框中添加iframe元素标记

Javascript 如何使用html在弹出对话框中添加iframe元素标记,javascript,jquery,html,css,iframe,Javascript,Jquery,Html,Css,Iframe,我想在弹出对话框中添加一个iframe。如何使用JavaScript将其添加到此弹出对话框中 我想在其中使用iframe 下面是我想在弹出窗口中显示的Iframe标记。您可以在iframe中添加任何网站。提前感谢你的帮助 <iframe src="http://www.w3schools.com"></iframe> 您不能在iFrame中显示google.com。原因是谷歌发送了一个“X-Frame-Options:SAMEORIGIN”响应头。此选项可防止浏览

我想在弹出对话框中添加一个iframe。如何使用JavaScript将其添加到此弹出对话框中

我想在其中使用iframe

下面是我想在弹出窗口中显示的Iframe标记。您可以在iframe中添加任何网站。提前感谢你的帮助

   <iframe src="http://www.w3schools.com"></iframe>

您不能在iFrame中显示google.com。原因是谷歌发送了一个“X-Frame-Options:SAMEORIGIN”响应头。此选项可防止浏览器显示与父页面不在同一域中的iFrame。这是一种防止点击劫持的安全功能。详情见

在下面的第一条评论后编辑: 我假设您希望在单击“新建对话框”按钮时在对话框中加载iframe。你能试着这样做吗:

last=$(<div/>").dialog(dialogOptions).dialogExtend(dialogExtendOptions).load("https://www.html5rocks.com/en/tutorials/cors/");
last=$(“”)。对话框(dialogOptions)。对话框扩展(dialogExtendOptions)。加载(“”)https://www.html5rocks.com/en/tutorials/cors/");

更新的fiddle:

特别是添加谷歌不是我的主要目标。我只想添加一个带有任何网站链接的iframe