Iframe src改变与Javascript不加载Chrome
Iframe src changed with Javascript not loading with Chrome
如何在chrome上加载javascript游戏?
Javascript:document.getElementById('game').src = "www.example.com";
使用IFRAME: <iframe src="/games/game.html" id="game"
style="display:block;margin:0 auto;" width="100%" height="100%"
frameborder="0" allowfullscreen="true" webkitallowfullscreen="true"
mozallowfullscreen="true" ></iframe>
或Flash:
<embed src="/games/game.swf" id="game" quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"
width="100%" height="100%">
Check This jsfield
它用jquery实现了这个技巧。
$("#click").click(function(){
$("#game").attr("src","https://jsfiddle.net/user");
});
HTML <span id="click">X</span>
<iframe src="https://jsfiddle.net/user/login/" id="game"
style="display:block;margin:0 auto;" width="100%" height="100%"
frameborder="0" allowfullscreen="true" webkitallowfullscreen="true"
mozallowfullscreen="true" ></iframe>
您的路径可能有一些问题,因此您可能还需要检查控制台是否有错误。
相关文章:
- 加载Chrome扩展中的脚本错误
- 页面加载代码上的Javascript使其重新加载chrome扩展
- jQuery dataTables对包装宽度的更改只有在加载chrome's检查员
- 重新加载 Chrome 扩展程序内容脚本执行环境
- 在推特流加载时加载 chrome 扩展脚本
- 如何在使用Javascript加载Chrome时计算图像
- 使用相对路径时无法加载chrome扩展内容脚本
- 正在尝试加载gif图像,但未加载chrome
- 我怎么能运行这个脚本时,标签重新加载(chrome扩展)
- 某些页面中未加载Chrome扩展
- Javascript元素在框架内从外部源加载(Chrome内容脚本)
- 在加载chrome扩展之前隐藏所有元素
- 为什么文本/按钮跳转页面加载(Chrome)
- Iframe src改变与Javascript不加载Chrome
- 重新加载Chrome DevTools扩展侧边栏在页面更改
- 页面重新加载chrome扩展消息发送
- jQuery加载Chrome而不是Firefox,为什么
- 我必须重新加载chrome扩展以显示通知
- 在新标签加载(Chrome)上突出显示URL/综合框文本
- Youtube如何控制Flash内容加载(Chrome 12)