Jump to content

Recommended Posts

Hi, I believe the error I'm receiving is JS related (though it may be php-related). Here is the page that I'm receiving the error on:

 

http://www.indianasheep.com/pages/map.php

 

The error is 'null' is null or not an object and it occurs whether you click on "Show All" or one of the other Member Types.

 

Any suggestions?

 

Ryan

hi,

 

This is the error i get

markers[i] is undefined

 

it means the array markers is not properly set or just empty

also i see this in your js

GDownloadUrl("scripts/markers.php", function(data) {

when i use

http://www.indianasheep.com/pages/scripts/markers.php

i get an 404 error page not found

 

when i use

http://www.indianasheep.com/scripts/markers.php without the pages

i see an xml.

 

so maybe using this(added slash)

GDownloadUrl("/scripts/markers.php", function(data) {

should work

Dj Kat,

 

Thanks for the reply and I apologize for my delay (it's the holidays). I see the error you are referring to (markers is undefined, but I'm still unable to figure out why, exactly, this is the case. I used your suggestion and added the backslash to the scripts/markers.php but this didn't help. What is confusing me is the fact that right now, all the markers are shown on the map with the correct colors. So it appears that everything is working. Moreover, when you click on a map marker, it brings up information that was stored in the markers[] array, so I'm just lost.

 

Any more advice as to what is going on here?

 

As always, thanks!

 

Ryan

Have you alert()'d markers to see what it holds?

 

Well, I used the following code to alert the array:

for (var i=0; i<=markers.length; i++) { alert(markers[i]); }

  and the output can be seen at http://www.indianasheep.com/pages/map.php. Obviously the array is not working, but I'm unable to figure out where it's going wrong.

 

Ryan

Alright, I finally figured it out. The error was due to 1 too many elements being in the array. All I did was change

 

for (var i=0; i<=markers.length; i++) { ... }

 

to

 

for (var i=0; i<markers.length; i++) { ... }

 

Thanks for the advice!

 

Ryan

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.