大家好,请教问题如下:
js:
function getCyPb() {
        var arrTr = appGrid.frameElement.getSelected();//此处为用户选中的行
        document.getElementById('appIframe').url = "DownExpertIframe.aspx?ExpertGUID=" + arrTr[0].ExpertGUID;//将选中行的ID作为参数传给iframe
        document.frames('appIframe').location.reload();//刷新iframe
    };html:
<iframe id="appIframe" src="DownExpertIframe.aspx" width="100%" height="100%" frameborder="0" scrolling="no" />就是想动态的设置iframe中url的参数,并在iframe指定的页面中得到参数,可是上面的方法有问题,我在DownExpertIframe.aspx中获取不到参数,请问如何解决,万分感谢!

解决方案 »

  1.   

    首先alert(arrTr[0].ExpertGUID); 看看取到了没有
    然后就是路径是否正确
      

  2.   

    document.getElementById('appIframe').src 吧?
      

  3.   

    直接设置src,不用再做reload操作了
    function getCyPb() {
    var arrTr = appGrid.frameElement.getSelected();//此处为用户选中的行
    document.getElementById('appIframe').src = "DownExpertIframe.aspx?ExpertGUID=" + arrTr[0].ExpertGUID;//将选中行的ID作为参数传给iframe
    }
      

  4.   

    document.getElementById('appIframe').scr = "DownExpertIframe.aspx?ExpertGUID=" + arrTr[0].ExpertGUID
      

  5.   

    应该是document.getElementById('appIframe').location