将HTA页面加载到iframe中

时间:2013-08-12 12:43:33

标签: javascript select iframe activex hta

我需要在其他网页中的iframe中插入hta页面。我选择了两个选项,在选择一个我需要将页面加载到iframe。我设法打开那个hta页面,但不是在iframe中,而是在新窗口中。

js code:

<script>

function runForm(){
WshShell = new ActiveXObject("WScript.Shell");
var dropdown = document.getElementById("dropdown");
var a = dropdown.selectedIndex; 
    if (a == 1)
    {
    document.getElementById("iframe").src = "forma1.hta";
    }
    else if (a == 2)
    {
     document.getElementById("iframe").src = "forma1.hta";
    }
}

</script>

html代码:

     <select onchange="runForm();" style="width:220px;margin-left:80px; margin-                    top:10px" id="dropdown" name="choice">
            <option value="" selected="default" disabled>Selektujte...</option>
            <option>1</option>
            <option>2</option>
     </select>
     <iframe application=yes  id="iframe" src="forma1.hta";  align="right" align="top" width="930" height="800">
     </iframe>

0 个答案:

没有答案