如果有人使用IE打开它,我想在我的html页面中更改值“href”。 起初,我尝试了按钮,但最终的目标是没有它。在Internet Explorer上更改href
这是我有:
<script type="text/javascript">
function myFunction()
{
var oldHTML = document.getElementById('troca').href="http://player.vimeo.com/video/39640718?title=0&byline=0&portrait=0"
var newHTML = document.getElementById('troca').href="http://www.youtube.com/embed/VwjI7ICgcJ0?rel=0";
if (navigator.appName!='Microsoft Internet Explorer')
{
**//what action i have to put in here?**
}
document.getElementById("troca").innerHTML=x;
}
</script>
</head>
<body>
<p>clique, se for internet explorer nao vai trocar nada!</p>
<button onclick="myFunction()">Troca</button>
<br/><br/>
<iframe id="troca" src="http://player.vimeo.com/video/39640718?title=0&byline=0&portrait=0" width="910" height="512" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</body>
是否有人知道我有什么就摆在那里我的代码修改?
对不起,我更新了正确的语法 – Jason
感谢兄弟!!!!! –
没问题:)如果这个答案解决了你的问题,不要忘了点击答案旁边的复选标记! – Jason