如何让这个javascript代码在Mac上运行
How to get this javascript code working on Mac
如何让这段代码在Safari(Mac OS)上运行
JavaScript
document.getElementById("name").src = "../index.html";
document.getElementById("name").herf = "http://google.com/index.html";
.html
<iframe id="name" src="../imghp" width="30%" height="103" name="iamiframe">
<p>Your Brower doesn't support iframe so: <a href="http://google.com/imghp">click</a></p>
</iframe>
你到底想干什么?
因为,如果您想将谷歌页面嵌入您的 iframe 中,并且如果不支持 iframe ,则期望此错误链接
<!DOCTYPE>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<iframe id="name" src="" width="30%" height="103" name="iamiframe">
<p>Your Brower doesn't support iframe so: <a href="http://google.com/imghp">click</a></p>
</iframe>
<script>
// or you can directly put in on the src iframe attribute
document.getElementById("name").src = 'http://www.test.com';
</script>
</body>
</html>
这段代码似乎有效,对你来说?
PS :如果你想直接 google.com iframe,我们将处理这个错误:拒绝在帧中显示"https://www.google.ca/?gfe_rd=cr&ei=JaOAVIe9GefE8genlYCoAQ&gws_rd=ssl",因为它将"X帧选项"设置为"SAMEORIGIN"
希望这有帮助,
C
相关文章:
- 如何使用phaser使html5游戏在移动设备浏览器上运行
- 使用压缩的JavaScript文件(不是运行时压缩)
- Javascript运行php文件,然后下载文件
- chrome扩展:尽管运行了at:documentidle,js脚本还是过早启动
- 我已经创建了一个jquery转盘,并使用if条件来运行和停止转盘
- Angularjs代码未在匿名函数中运行
- jquery设置为使用参数运行
- 如何根据时间运行不同的脚本
- Safari(Mac OS)上的jQuery平滑滚动问题
- MAC操作系统-如何通过Java类运行应用程序(.app)
- console.log无法运行Mac OS X
- 在Mac OSX上运行MongoDB时出现问题
- 在 Mac OSX 10.11 上的 MAMP 3.5 上运行 python-script
- 节点 js 退出状态 8,错误代码 0 在 Mac 上运行
- 如何让这个javascript代码在Mac上运行
- 告诉浏览器是运行在windows还是mac/linux上的chrome
- 在Mac OS X上运行缓慢
- 问题运行样本在Mac Pro X86_64 V8引擎
- 如何使用Node.js获取在Mac前台运行的应用程序窗口的坐标
- 如何在Mac OS X Snow Leopard中运行XUL应用程序