Author Topic: Error on my page  (Read 1525 times)

0 Members and 1 Guest are viewing this topic.

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Error on my page
« on: May 06, 2010, 05:37:51 AM »
I get the following error on my page.



Here is the code, what wrong with it?

Code: [Select]
<script type="text/javascript">
<!--
var time = 5000;
var numofitems = 11;

//menu constructor
function menu(allitems,thisitem,startstate){
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem; 
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.visibility = startstate;
}

//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden"; (Line 48)
  }
  theobj.thediv.style.visibility="visible";
}

function closesubnav(event){
  if ((event.clientY <48)||(event.clientY > 125)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
      shutdiv.style.visibility='hidden';
    }
  }
}
// -->
</script>
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline DanS

  • Chiang Mai weather
  • Forecaster
  • *****
  • Posts: 5434
    • ThaiWx
Re: Error on my page
« Reply #1 on: May 06, 2010, 06:22:53 AM »
Hi Lars,

I'm in the dark when it comes to this stuff but noticed one line of the code has " "  around the menuitem text and the other line just has single quotes ' ' around the same text. Is that the way it's supposed to be?

var shutdiv =eval( "menuitem"+i+".thediv");

var shutdiv =eval('menuitem'+i+'.thediv');
« Last Edit: May 06, 2010, 07:02:54 AM by DanS »

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Error on my page
« Reply #2 on: May 06, 2010, 03:39:59 PM »
One strange thing is that is that i don't get that error every time I load my page.

Hi Lars,

I'm in the dark when it comes to this stuff but noticed one line of the code has " "  around the menuitem text and the other line just has single quotes ' ' around the same text. Is that the way it's supposed to be?

var shutdiv =eval( "menuitem"+i+".thediv");

var shutdiv =eval('menuitem'+i+'.thediv');

Thanks Dan

I did change to  " ", I will see if that work.
« Last Edit: May 06, 2010, 03:45:53 PM by Axelvold »
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Error on my page
« Reply #3 on: May 07, 2010, 06:03:41 AM »
That did not work, any other suggestion on what could be wrong?
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline DanS

  • Chiang Mai weather
  • Forecaster
  • *****
  • Posts: 5434
    • ThaiWx
Re: Error on my page
« Reply #4 on: May 14, 2010, 03:14:43 AM »
Lars, did you ever find a solution and get it resolved?

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: Error on my page
« Reply #5 on: May 14, 2010, 05:46:05 AM »
No, I still get that error. :-(
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

 

anything