0
而不是在STAT中创建许多swat集以将每个独特的iFrame迁移到多层环境,我想创建一个JavaScript,根据主机名调用正确的iFrame并迁移所有iFrame在单一的swat中适用于每个环境。多个主机名需要每个URL的唯一iframe
<script type="text/javascript">
function selectiFrame() {
if (window.location.hostname == "padv.abc.com") {
document.getElementById("padv").style.display="block";}
else {if (window.location.hostname == "paqa.abc.com") {
document.getElementById("paqa").style.display="block";}
else {if (window.location.hostname == "pacp.abc.com") {
document.getElementById("pacp").style.display="block";}
else {if (window.location.hostname == "papd.abc.com") {
document.getElementById("papd").style.display="block";}
}
}
</script>
<body onLoad="selectiFrame();>
<iframe id="padv" src="padv.html" frameborder="0" height="1px" width="1px" scrolling="no">
<p>Your browser or device does not support iframes.</p>
</iframe>
<iframe id="paqa" src="paqa.html" frameborder="0" height="1px" width="1px" scrolling="no">
<p>Your browser or device does not support iframes.</p>
</iframe>
<iframe id="pacp" src="pacp.html" frameborder="0" height="1px" width="1px" scrolling="no">
<p>Your browser or device does not support iframes.</p>
</iframe>
<iframe id="papd" src="papd.html" frameborder="0" height="1px" width="1px" scrolling="no">
<p>Your browser or device does not support iframes.</p>
</iframe>
任何有助于使此代码可行的赞赏。
让我试试看马克,我很欣赏你的快速反应。 – Sanden