Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Debugging extjs app in IE7?

  1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    294

    Default Debugging extjs app in IE7?

    Hey all,
    My extjs app shows up fine in Firefox and Chrome, but in IE7 it hangs giving a few indicipherable errors
    like:

    "Line: 26
    Char: 2
    Error: Expected identifier, string or number
    Code: 0
    Url: ...."

    Because the page is all loaded, its hard to trace the line number or view it from IE. How are other people tackling this problem with their apps?

    thanks for any tips.

  2. #2

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Also, IE8 has an integrated debugger and you can enable the IE7 emulation mode.

  4. #4
    Sencha Developer
    Join Date
    Sep 2008
    Location
    Antioch, IL
    Posts
    1,516

    Default

    When does the error display?

    If it displays when the page first loads, you (almost certainly) have an extra comma or errant character in your code... probably at (or more likely, before) the 26th line of the JS file or "script" tag containing your code.

    If it displays on an event of some kind (a mouse click, an Ext object event like 'load', a new tab opening, etc.) use that information to check the section of code involved.

    I was using DebugBar in IE7 to help with my AJAX calls (basically to monitor the console), but it doesn't do much for debugging your actual JS code the way that Firebug can.

  5. #5
    Sencha User
    Join Date
    Nov 2007
    Posts
    294

    Default

    Thanks guys. Sorry for being a stooge and missing it in the FAQ.

    IE7 is really the pits. I will get the IE8 beta and try that console.

    EDIT:
    arthurakay

    Displays on load. And the view is blank.

  6. #6
    Sencha User
    Join Date
    Nov 2007
    Posts
    294

    Default

    Just wanted to follow up on this with a useful tip others might not know.

    The Netbeans IDE (www.netbeans.org) has javascript editing that red-flags trailing commas for IE compatibility. Its free and cross-platform, so maybe a good alternative for those of us developing on linux or not using Visual Studio, etc.

    Just a heads up!

  7. #7
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default

    http://github.com/hallettj/jslint.vim/tree/master

    JSLint plugin for vim.

    EDIT:

    And good luck with the IE8 thing. I tried it and it freezes when running ExtJS code.

    EDIT #2:

    Microsoft's Visual Web Developer is free and debugs JS in IE7.

  8. #8
    Sencha User
    Join Date
    Nov 2007
    Posts
    294

    Default

    I wasn't able to install IE8 on Vista x64. Go figure. I'm happy to avoid the headache of anything beginning with the letters IE...

    But netbeans actually works great to develop EXTJS (I develop on linux desktop) and it has the equivalent of Intellisense for javascript, so when I type instances of my ExtJS objects in the editor, I get popups of method completions. color coded, etc. So its great for a free cross-platform tool.

  9. #9
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664

    Default

    Quote Originally Posted by Sesshomurai View Post
    red-flags trailing commas for IE compatibility. Its free and cross-platform, so maybe a good alternative for those of us developing on linux
    This is an alternative: http://blog.extjs.eu/philosophy/lead...-the-question/

    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  10. #10
    Sencha User mschwartz's Avatar
    Join Date
    Nov 2008
    Location
    San Diego, Peoples' Republic of California
    Posts
    2,061

    Default

    Quote Originally Posted by jsakalos View Post
    Tried it, and actually liked it a lot. The big issue with it is that numerous IDEs have "format code" functions that screw up royally on the leading commas.

    It's also, IMO, a good idea to always use { and newlines for things like if and for statements:
    Code:
    // ALWAYS DO THIS:
    if (foo) {
      bar();
    }
    vs.

    Code:
    // NEVER DO THIS:
    if (foo) bar();
    Why?

    Try setting a breakpoint with firebug (or any other debugger) at the bar() call in the 2nd example

Page 1 of 2 12 LastLast

Posting Permissions

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