使用Javascript函数重新加载HTML元素

Dex*_*ave 2 html javascript

我在DIV中嵌入了一个flash对象.现在我想在该div上方使用一个链接('a'标签),以便用户能够重新加载该闪存拨号器,或者更具体地说,它包含在其中的div标签(我无法以任何方式更改闪存文件).

我已尝试使用下面的这个JS函数,但它不起作用(在点击'reload'链接时不会重新加载div和内容.

<div class="userProfile">
<script type="text/javascript">
     function refreshDialer(){
             document.getElementById("dialerDiv1").contentWindow.location.reload(true);
            }
</script>
<a href="javascript: refreshDialer()">Reload</a>
<div id="dialerDiv1">
    <embed type="application/x-shockwave-flash" wmode="opaque"                     
            src="http://dummysite.com"
            width="301"
            height="401"
            id="popUpSwf"
            name="popUpSwf"
            quality="high"
            border="none"
            allowscriptaccess="always"
                            pluginspage="http://www.adobe.com/go/getflashplayer"
            scale="noscale"
            menu="false"
            flashvars="#" />
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

我在这做错了什么?

谢谢

Pla*_*ker 6

试试这个:

function refreshDialer(){
   //alert("In function");
   var container = document.getElementById("dialerDiv1");
   var content = container.innerHTML;
   //alert(content);
   container.innerHTML= content;
}
Run Code Online (Sandbox Code Playgroud)

使用youtube链接的操作中作为示例.