Jtcarlson3
09-18-2004, 02:47 PM
Hello,
I am getting a 'objIframe' is null or not an object error on this page http://www.findgolfusa.com/arizona_index.asp?Ad=8 , its a java error in the menu status bar on the bottom. Sometimes it doesnt show up on load and sometimes it does. Also some ppl dont get this error at all and the map links on that map work for some and others it doesnt work and gives that error when you click on one of the map links. Basically the javascript is a .hash switch case that is telling it what file to load in the iframe depending on what link you click. I have tried everything and can not figure out why its doing this. It runs perfect if I run it locally but I get the errors and it doesnt work if I run it from the web. Alot of my friends run it from the web and it works sometimes for them and sometimes not.. Any ideads ??
Code for the script;
<script language="javascript" defer>
var strHash = location.hash;
var objIframe = document.getElementById('main');
var objAframe = document.getElementById('ads');
//-->var stCounty = <% Response.Write(strCounty) %>;
//-->var stAd = <% Response.Write(intAd) %>;
switch (strHash)
{
case "#arizona":
objIframe.src = 'maps/arizona2.htm';
break;
case "#apache":
objIframe.src = 'maps/az_apache_map.htm';
break;
case "#cochise":
objIframe.src = 'maps/az_cochise_map.htm';
break;
case "#coconino":
objIframe.src = 'maps/az_coconino_map.htm?Ad=5';
break;
case "#gila":
objIframe.src = 'maps/az_gila_map.htm?Ad=4';
break;
case "#graham":
objIframe.src = 'maps/az_graham_map.htm';
break;
case "#greenlee":
objIframe.src = 'maps/az_greenlee_map.htm';
break;
case "#la_paz":
objIframe.src = 'maps/az_la_paz_map.htm?Ad=5';
break;
case "#maricopa":
objIframe.src = 'maps/az_maricopa_map.htm?Ad=6';
break;
case "#mohave":
objIframe.src = 'maps/az_mohave_map.htm?Ad=8';
break;
case "#navajo":
objIframe.src = 'maps/az_navajo_map.htm?Ad=10';
break;
case "#pima":
objIframe.src = 'maps/az_pima_map.htm';
break;
case "#pinal":
objIframe.src = 'maps/az_pinal_map.htm';
break;
case "#santa_cruz":
objIframe.src = 'maps/az_santa_cruz_map.htm';
break;
case "#yavapai":
objIframe.src = 'maps/az_yavapai_map.htm?Ad=5';
break;
case "#yuma":
objIframe.src = 'maps/az_yuma_map.htm';
break;
default:
objIframe.src = 'maps/arizona2.htm';
}
And on the map page with the links I just add in #gila (example) on the link..
Thanks
Joe
I am getting a 'objIframe' is null or not an object error on this page http://www.findgolfusa.com/arizona_index.asp?Ad=8 , its a java error in the menu status bar on the bottom. Sometimes it doesnt show up on load and sometimes it does. Also some ppl dont get this error at all and the map links on that map work for some and others it doesnt work and gives that error when you click on one of the map links. Basically the javascript is a .hash switch case that is telling it what file to load in the iframe depending on what link you click. I have tried everything and can not figure out why its doing this. It runs perfect if I run it locally but I get the errors and it doesnt work if I run it from the web. Alot of my friends run it from the web and it works sometimes for them and sometimes not.. Any ideads ??
Code for the script;
<script language="javascript" defer>
var strHash = location.hash;
var objIframe = document.getElementById('main');
var objAframe = document.getElementById('ads');
//-->var stCounty = <% Response.Write(strCounty) %>;
//-->var stAd = <% Response.Write(intAd) %>;
switch (strHash)
{
case "#arizona":
objIframe.src = 'maps/arizona2.htm';
break;
case "#apache":
objIframe.src = 'maps/az_apache_map.htm';
break;
case "#cochise":
objIframe.src = 'maps/az_cochise_map.htm';
break;
case "#coconino":
objIframe.src = 'maps/az_coconino_map.htm?Ad=5';
break;
case "#gila":
objIframe.src = 'maps/az_gila_map.htm?Ad=4';
break;
case "#graham":
objIframe.src = 'maps/az_graham_map.htm';
break;
case "#greenlee":
objIframe.src = 'maps/az_greenlee_map.htm';
break;
case "#la_paz":
objIframe.src = 'maps/az_la_paz_map.htm?Ad=5';
break;
case "#maricopa":
objIframe.src = 'maps/az_maricopa_map.htm?Ad=6';
break;
case "#mohave":
objIframe.src = 'maps/az_mohave_map.htm?Ad=8';
break;
case "#navajo":
objIframe.src = 'maps/az_navajo_map.htm?Ad=10';
break;
case "#pima":
objIframe.src = 'maps/az_pima_map.htm';
break;
case "#pinal":
objIframe.src = 'maps/az_pinal_map.htm';
break;
case "#santa_cruz":
objIframe.src = 'maps/az_santa_cruz_map.htm';
break;
case "#yavapai":
objIframe.src = 'maps/az_yavapai_map.htm?Ad=5';
break;
case "#yuma":
objIframe.src = 'maps/az_yuma_map.htm';
break;
default:
objIframe.src = 'maps/arizona2.htm';
}
And on the map page with the links I just add in #gila (example) on the link..
Thanks
Joe