JS部分<script>function showPage(index){
if(index==1)
document.getElementById("showFrame").src="test1.jsp";
else if(index==2)
document.getElementById("showFrame").src="test2.jsp";
else if(index==3)
document.getElementById("showFrame").src="test3.jsp";
}
</script>网页部分<body><a href="" onclick="showPage(1);">测试</a>
<a href="" onclick="showPage(2);">添加1</a>
<a href="" onclick="showPage(3);">添加2</a><br>
<iframe id="showFrame" frameBorder="0" scrolling="auto" src="" width="100%" align="left"></iframe>
</body>为什么当我点击超链接的时候,eclipse会提示指定的路径拒绝访问,网页显示为空白,test1、test2、test3都和网页在一个文件夹内,应该不存在跨域问题,访问的时候我是使用localhost进行访问
if(index==1)
document.getElementById("showFrame").src="test1.jsp";
else if(index==2)
document.getElementById("showFrame").src="test2.jsp";
else if(index==3)
document.getElementById("showFrame").src="test3.jsp";
}
</script>网页部分<body><a href="" onclick="showPage(1);">测试</a>
<a href="" onclick="showPage(2);">添加1</a>
<a href="" onclick="showPage(3);">添加2</a><br>
<iframe id="showFrame" frameBorder="0" scrolling="auto" src="" width="100%" align="left"></iframe>
</body>为什么当我点击超链接的时候,eclipse会提示指定的路径拒绝访问,网页显示为空白,test1、test2、test3都和网页在一个文件夹内,应该不存在跨域问题,访问的时候我是使用localhost进行访问
或者你把上面的内容保存为单独一个文件试试