gpt4 book ai didi

html - iframe 标签不工作 android inbuild 浏览器?

转载 作者:太空宇宙 更新时间:2023-11-04 13:25:11 26 4
gpt4 key购买 nike

我正在使用 phonegap(html、javascript)开发跨平台移动应用程序问题是所选项目相关图像未在 iframe 中显示,此图像显示另一个页面,请参见下面的代码

function onchangeevent(mySelect)
{
PageIndex2=mySelect.selectedIndex;
{
if
(
mySelect.options[PageIndex2].value != "none"
)
{
frames['iframe2'].location.href = mySelect.options[PageIndex2].value;
}

}
}
</script>
</head>
<body>
<form name="form">
<p><select NAME="selectimage" SIZE="1" onChange="onchangeevent(this.form.selectimage)">
<option VALUE="none" SELECTED>Select a page and go</option>
<option VALUE="ic_launcher.png">one</option>
<option VALUE="icon.png">two</option>
</select> </p>
<p>
<IFRAME NAME="iframe2" frameborder="3" ALIGN="top" HEIGHT="100%" WIDTH="95%" HSPACE="10" VSPACE="10" align="middle"></IFRAME>
</p>

</form>
</body>
</html>

iframe 标签不工作 android inbuild 浏览器如何解决这个问题?请告诉所有浏览器支持的任何替代标签预先感谢摇摇欲坠

最佳答案

正如您在此处 Posting form to a hidden iframe in Android browser 的上一个问题中看到的那样

future 的浏览器/标准将不支持 iframe。

相反,创建一个图片标签并更新它的 SRC。

function onchangeevent(mySelect)
{
PageIndex2=mySelect.selectedIndex;
{
if
(
mySelect.options[PageIndex2].value != "none"
)
{
document.getElementById('myimage').src = mySelect.options[PageIndex2].value;
}

}
}
</script>
</head>
<body>
<form name="form">
<p><select NAME="selectimage" SIZE="1" onChange="onchangeevent(this.form.selectimage)">
<option VALUE="none" SELECTED>Select a page and go</option>
<option VALUE="ic_launcher.png">one</option>
<option VALUE="icon.png">two</option>
</select> </p>
<p>
<img src="about:blank" id="myimage" alt="" />
</p>

</form>
</body>
</html>

关于html - iframe 标签不工作 android inbuild 浏览器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9178189/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com