I have this script that’s working fine in IE, but seems to be breaking in Opera and FF. Below are the two pages involved. Can anyone see what’s going on here?
Working sample: [URL=”http://sosimagesonline.com/testing/linkpage”]http://sosimagesonline.com/testing/linkpage
[code=html]<head>
<title> Page title </title>
</head>
<body>
<a href=”framepage.htm?changeme= http://www.google.com” >Google</a>
<a href=”framepage.htm?changeme= http://sosimagesonline.com” >Sos Images Online</a>
<a href=”framepage.htm?changeme= http://www.2flashgames.com” >2flash</a>
</body>
</html>
[code=html]<head>
<script language=”JavaScript” type=”text/javascript”>
function iframe_src()
{
var locsubstr = location.search.substring(1);//find url parameter
if((locsubstr.indexOf(“changeme”)!= -1))//if there is a new path for changeme
{
var changemeloc = locsubstr.substring(locsubstr.indexOf(“=”) + 1, locsubstr.length);//find the newpath for changeme
parent.frames[0].location.replace(changemeloc);//change changeme to new path
}
else
{parent.frames[0].location.replace(defaultpath);}//if there isn’t a new path, set changeme to default
}
</script>
</head>
<body onload = “iframe_src()”;>
<iframe src=”default.htm” height=”800″ width=”800″ id=”changeme” name=”changeme”></iframe>
</body>
</html>
What should happen is that the clicked link on the first page will open the second page with new content in the iframe, rather than the default iframe src.