I have a script working for me which loads content into an iframe on my index page based on a url query string. for example: mysite.com/index.php?two.php loads "two.php" into the iframe, heres what i have:
<script type="text/javascript">
function loadIframe()
{
var urlStr;
urlStr = location.search.slice(1);
window.frames.myiframename.location = urlStr;
}
</script>
Next, I call the function in the body onload:
<body onLoad="loadIframe()">
Only problem is when navigating to "www.mysite.com" the onload function loops and loads subsequent index pages into each others iframes. How can I set the default frame src to "home.php" and tell my javascript function only to execute if there is a query in the url string?