|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error: 1 is null or not an object
Can anyone help me with this problem?
Everything actually works just fine on this page, but the annoying Error on page comes up with this error: Error: 'links[..].1" is null or not an object The code looks like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "(URL address blocked: See forum rules)"> <html> <head> <link rel="stylesheet" type="text/css" href="ptsa.css" /> <script language=javascript src="lists.js"></script> <script language=javascript src="mainscripts.js"></script> <script type="text/javascript" language="JavaScript1.2" src="menu.js"></script> </head> <body background="bigbear_t.png"> <body> <script language=javascript> var thisaddress = window.location.href; var thispage = delineate(thisaddress); writeheader(); writeleftnav(thispage); writeleftimg(); links.sort(sortbasic); </script> <td id=content> <p class=title><b>Links</b></p> <ul><script language=javascript> for (count=0;count<links.length;count++) {document.write("<li><a href=" + links[count][1] + ">" + links[count][0] + "</a></li>");}</script> </ul> </td> <script language=javascript> writerightnav(); closepage(); </script> </body> </html> There is a mainscript.js that contains the functions, but the problem seems to be in this .htm file. Thank you for your help! |
|
#2
|
|||
|
|||
|
Hi,
In one of the .js files the links object is set to some list of values. I guess it is lists.js The html page code is not helpful since it creates alot of errors and also I can not see whether there is a javascript code related with links variable in the included javascript files. Eralper http://www.kodyaz.com |
|
#3
|
|||
|
|||
|
Quote:
Code:
for (count=0;count<links.length;count++) links.length is not the amount of times you want to loop. don't forget an array starts with links[0] so you want to loop one less time.. loopAmount = links.length -1 that's what is causing the error.. on the last loop : links[is not there +1 more than you have] just replied to the same question from 2003! lol was doing a search -- so i ended up here... funny |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Error: 1 is null or not an object |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|