日期:2014-05-18  浏览次数:20402 次

iframe javascript:location.replace(url)路径问题
JScript code

<div class="collapsed"><span>测试菜单</span>
        <b><a target="iFrameMain" href="javascript:document.location.replace('web/a.html')">a.html</a></b>
        <b><a target="iFrameMain" href="javascript:document.location.replace('web/b.html')">b.html</a></b>
</div>
<iframe id="iFrameMain" name="iFrameMain" scrolling="auto" src="" frameborder="0" ></iframe>



a href 路径会重叠(web/web/a.html)
这个怎么处理。


------解决方案--------------------
javascript:document.location.replace('web/a.html')

不要用replace,自己计算

javascript:document.location = "http://www.csdn.net" + "/web/a.html";
------解决方案--------------------
<b><a target="iFrameMain" href="javascript:document.location.replace('a.html')">a.html</a></b>