Angelin Nadar
Angelin Nadar

Reputation: 9300

How to solve error: "undefined is null or not object ie in ext js" in IE?

I think its the cause of trailing comma, or syntax error, variable used without declaration. My js fiel is 1000 lines od code. Since the error is not provding me the line no. Its becoming dfficult to debug. Please help me with debugging techniques for IE. The script works very well with Firefox, Safari.

Upvotes: 5

Views: 17679

Answers (7)

BuzzWasHere
BuzzWasHere

Reputation: 41

I had this issue using the Extjs RowExpander user extension. The issue only occurred in IE. I was able to fix it by adding a few lines of code at the top of the 'toggleRow' method:

if (!this.view) {
    this.bindView();
}

For some reason IE occasionally chokes on references to 'this.view' (likely a timing issue). Running 'bindview()' ensures that 'this.view' resolves appropriately.

Upvotes: 0

Angelin Nadar
Angelin Nadar

Reputation: 9300

Guys, I finally did it ? I took the strength of all your techniques.

1) I put the code in a single try{ code } and catch(e) { alert('Final Err: '+ e.description); }

and kept initial 200 lines uncommented and the rest commented and ran the file

while(EOF) {
  if(got an alert of error)
    checked for trailing commas & putting missed semicolons till end.
  else
     adding some more lines later uncommented out of the commented and ran the file.
}

Finally, the page got succesfully loaded !!!

Upvotes: 0

MMT
MMT

Reputation: 2216

If you are using eclipse :

configure spket plug-in editor for java script

It will highlight the missing/incomplete syntax (e.g comma/semicolon)

so you don't need to debug for syntax errors

Upvotes: 0

wombleton
wombleton

Reputation: 8376

I'd jslint the file. That will find the issue as well as any others you may have.

You can run it as a command line utility via node.

Upvotes: 5

Chau
Chau

Reputation: 5570

If you are developing through Microsoft Visual Studio I remember it will help you find trailing commas by highlighting the following } element with a green curly underline.

If you use the built-in developer tools in IE8 and later, you can step through your code in the browser and determine which line causes the error - starting from the top.

If you are not using any debugging tools in IE, then I will advise you to - just like Johan and bjornd are suggesting.

Happy hunting :)

Upvotes: 1

Johan Olsson
Johan Olsson

Reputation: 618

include this <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script> and <html debug="true"> will give you an firebug console
http://getfirebug.com/firebuglite#Debug

Upvotes: 4

bjornd
bjornd

Reputation: 22943

For debugging in IE I would recommend you install DebugBar. This extension is similar to FireBug for Firefox.

Upvotes: 1

Related Questions