2017-09-15 30 views
1

你好,我想尝试iframe这个元素https://allnepaliconverter.com/ok/demo_iframe.html但他们的键盘似乎并没有iframed。不能iframe我的网站的某些页面

HTML代码如下

<!DOCTYPE html> 
<html> 
    <title>Virtual Keyboard</title> 


<meta name="robots" content="noindex, nofollow"> 

    <script type="text/javascript" src="vk_iframe.js?vk_skin=goldie&vk_layout=IN Devanagari" ></script> 

</head> 
<body> 
    <form action="no.cgi" method="get"><strong> 
    <p style="color: red;font-family: sans-serif;"> Enter From The Keyboard Below Using Mouse Or Your Hardware Keyboard Device </p></strong> 

    <textarea id="text" cols="72" rows="10" wrap="soft" onfocus="IFrameVirtualKeyboard.attachInput(this)"></textarea> 

     <div id="td"></div> 
     <body onload="IFrameVirtualKeyboard.toggle('text','td'); return false;" > 

</form>  
</body> 
</html> 
+0

那么它在哪里是一个iframe中的测试页? – epascarello

回答

2

如果你看看你的控制台,你应该看到:

Uncaught DOMException: Blocked a frame with origin "https://allnepaliconverter.com" from accessing a cross-origin frame. 

这就解释了为什么键盘不打印。 看看here了解详细解释和可能的解决方法。

+0

我知道它,但我不知道周围的工作:( –

+0

一种可能的解决方法是重现您的网站上的页面:获取脚本,重现HTML ... – rabsom

0

键盘可能是由同一来源的javascript加载的iframe。浏览器会阻止试图访问具有不同原点的帧的脚本。

+0

我知道它,但我不知道解决: –

相关问题