Results 1 to 5 of 5

Thread: error in text file?

  1. #1
    Join Date
    Jul 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default error in text file?

    http://mysite.verizon.net/res8szeo/reader has three javascript errors in text files and I just can't figure out why.

  2. #2
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    What do you do with responseText then??

  3. #3
    Join Date
    Jul 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    what do you mean?
    I split it. then I put it in an array.
    then I search the array
    but the errors are in the text files themselves. (I am using firefox)

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Opera tells a different story:
    Code:
    JavaScript - http://mysite.verizon.net/res8szeo/reader/
    Inline script thread
    Error:
    
    name: TypeError
    
    message: Statement on line 15: Could not convert undefined or null to object
    Backtrace:
      Line 15 of linked script http://mysite.verizon.net/res8szeo/reader/reader.js
    
        while (! (words[i].indexOf(currentword.innerHTML + " ") === 0))
          Line 6 of inline#1 script in http://mysite.verizon.net/res8szeo/reader/
    
        definecurrentword();
    Code:
    while(!(words[i].indexOf(currentword.innerHTML+" ") === 0))
    	{
    		i++;
    		if(i===words.length)break;
    	}
    That should be:
    Code:
    while(!(words[i].indexOf(currentword.innerHTML+" ") === 0))
    	{
    		i++;
    		if(i===words.length-1)break;
    	}
    Even better, use a for loop:
    Code:
    for(var i = 0; i < words.length && words[i].indexOf(currentword.innerHTML.toString() + " ") !== 0; ++i) {}
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jul 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I made some changes. It would apeare that the getellementbyid function is returning null for some reason. so as you can see, I played around with that a bit, with no luck though. now I am really confuses, because opera is giving me errors in commented out code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •