rndilger Posted December 26, 2008 Share Posted December 26, 2008 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 Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted December 26, 2008 Share Posted December 26, 2008 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 Quote Link to comment Share on other sites More sharing options...
rndilger Posted December 28, 2008 Author Share Posted December 28, 2008 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 Quote Link to comment Share on other sites More sharing options...
corbin Posted December 28, 2008 Share Posted December 28, 2008 Have you alert()'d markers to see what it holds? Quote Link to comment Share on other sites More sharing options...
rndilger Posted December 28, 2008 Author Share Posted December 28, 2008 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 Quote Link to comment Share on other sites More sharing options...
rndilger Posted December 28, 2008 Author Share Posted December 28, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.