请教关于iframe打开特定的页面的问题
k.asp里面有一个iframe
请问怎样能
点击a连接的时候,打开的k.asp,并且iframe显示x.asp
点击b连接的时候,打开的k.asp,并且iframe显示y.asp
点击c连接的时候,打开的k.asp,并且iframe显示z.asp
------解决方案-------------------- <a href= "k.asp?x.asp "> a </a>
<a href= "k.asp?b.asp "> b </a>
<a href= "k.asp?c.asp "> c </a>
---------
k.asp
<iframe id= 'fm '> </iframe>
<script>
var ifm = document.getElementById( 'fm ');
var url = location.search;
//alert(url.substring(1,url.length));
ifm.src=url;
</script>
------解决方案--------------------k.asp里面加上:
<script type= "text/javascript ">
function initTool()
{
var url = location.href;
var iStart = url.indexOf( "# ");
if (iStart != -1)
{
tag = url.substring(iStart+1);
document.all.nr.src=tag+ ".asp "
}
else
{
document.all.nr.src= "k.asp ";
}
}
</script>
iframe这样写:
<iframe width= "100% " height= "560 " name= "nr " align= "middle " scrolling= "no " frameborder= "0 " src= " "> </iframe>
旁边调用JS: <script language= "javascript "> initTool(); </script>
联接这样写: <a href= "/k.asp#x " target= "_blank ">