Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.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 如何强制IFrame中的超链接在新窗口中打开?_Javascript_Jquery_Html_Css_Iframe - Fatal编程技术网

Javascript 如何强制IFrame中的超链接在新窗口中打开?

Javascript 如何强制IFrame中的超链接在新窗口中打开?,javascript,jquery,html,css,iframe,Javascript,Jquery,Html,Css,Iframe,我的代码粘贴在下面:- <!DOCTYPE html> <html> <head> <base target="_blank"> </head> <body> <div style="border: 2px solid #D5CC5A; overflow: hidden; margin: 15px auto; max-width: 800px; max-height: 1750px;"> <bas

我的代码粘贴在下面:-

<!DOCTYPE html> 
<html> 
 <head>
<base target="_blank">
</head>
<body> 

<div style="border: 2px solid #D5CC5A; overflow: hidden; margin: 15px auto; max-width: 800px; max-height: 1750px;">
<base target="_blank" />
<iframe name="myIframe" scrolling="auto" src="http://example.com" style="border: 0px none; margin-left: -30px; height: 4000px; margin-top: -900px; width: 850px;">
</iframe>
</div>
</body> 
</html> 


我尝试过使用目标属性,但不起作用。请帮忙。

我希望这对你有用:

<!DOCTYPE html> 
<html> 
 <head>
<base target="_blank">
</head>
<body> 

<div style="border: 2px solid #D5CC5A; overflow: hidden; margin: 15px auto; max-width: 800px; max-height: 1750px;">
<base target="_blank" />
<iframe name="myIframe" scrolling="auto" src="http://example.com" style="border: 0px none; margin-left: -30px; height: 1000px; width: 850px;">
</iframe>
</div>
</body> 
</html> 


我计算了利润率top的值:-900px;在视图区域中获取所需的文档。

请展示您的尝试,所提供的示例上没有链接。还要详细解释问题,“未工作”不是正确的问题描述。“如何强制IFrame中的超链接打开到新窗口?”--首先,如果您没有访问原始资源的权限,则无法在IFrame中更改任何内容。第二件事,这个问题很难理解,请详细说明。我很确定边距对超链接的目标没有影响。