Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Advanced Debug Info

    Hi,
    I'm writing a Javascript that helps one to find errors in other Javascript code, but in comparsion to the default error reports this one gives you a function call history, that means you will see on what way the function was called anyway (eg... start() called generateinfo() called parsestring() called findPattern()) as well as the parameters handed over to each of those functions (parsestring(string="Hallo Welt!"...) and it checks every object in the error producing line if it exists ("hallo" is not valid in "document.forms.hallo.style"...) so you mostly can see the error immidiately. I optimized my code so far that it will detect if the object is an function a var declared in the error-throwing function before the error occures or a global var/object.
    Just take a lool at http://www.koabi.de/etz/?debug=1 and press the Produce Error button.
    Note that this code works with Internet Explorer (6?) only.
    I'm still working on it but when it's ready all you will have to do is copying 2 files to a subdir calles "debug" and add "<script src=debug/debug.js>".
    Just wanted to know if there is interest in such a tool.

  • #2
    Regular Coder
    Join Date
    Jun 2004
    Posts
    194
    Thanks
    5
    Thanked 0 Times in 0 Posts
    That sounds like quite a good idea, epecially if it will be able to tell you exactly what line the error is on and what specifically is wrong with the script. The default "Error On Page" generated by Internet Explorer usually isn't helpful, it does tell you the line and character and whats wrong, however a lot fo the time this isn't even correct, I've come across that a few times in the past and the error turned out to be something completely different. With the built in error message in Internet Explorer being about as helpful as a Japanese VCR instruction manual i'd imagine a few people will be interested in this.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not so sure, it will be helpful.
    Initial script development is done using Moz that has plenty of debugging tools. When time comes to adjust the code for IE stoopidity, the general implementation bugs are taken care of.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    FWIW: Using IE 6.2 I got nothing.
    Nothing on your site work for me including your links.
    Could be my security settings and although I am interested in such a thing, I am not interested in relaxing my settings.

    .....Willy

  • #5
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I dont know IE 6.2 but after installing ServicePack2 on WinXP running Javascripts in IE often is blocked and there is kind of a banner in the top of the site where you can allow Javascripts to be ran.
    What links do you mean?

  • #6
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    console, help, ect....

  • #7
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, now i know, those are Javascript too. I coded some window manager with tabs, so when you click a link it changes to that tab without changing the page, so if you have JS disabled it's clear why they don't work. I think I got to get IE 6.2 myself to see what's the problem.

  • #8
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I do not have javascript disabled. I have Active X, Flash and VBS disabled (perhaps a few others. I would have to check) but not javascript. (I wouldn't hang out in a javascript forum if I did)

    .....Willy

    BTW: If this helps....
    Detected: Windows XP SP1 (WinNT 5.01.2600)
    Detected: Internet Explorer v6.00 SP1 (6.00.2800.1106)

    Edit: oooh;

    Apparently, somehow I lost 6.2
    I wonder if this was caused by corrupting my profile in some way?
    I will need to check if those values are correct.
    Last edited by Willy Duitt; 06-24-2004 at 06:51 PM.

  • #9
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you get a Javascript Error by IE? It's odd, i tried my scripts on various PCs, all having IE 6.0 and it works on all of them, I have no idea why it isn't working at yours. It would be great if you could give me some more information, a screenshot maybe of the page as it is displayed in your browser.

  • #10
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Line: 4
    Char: 2
    Error: 'document.all.grizly.style'
    is null or not an object...

    Attached is a screenshot.
    Hope that helps;
    .....Willy
    Attached Thumbnails Attached Thumbnails Advanced Debug Info-debuggerscreenshot.jpg  

  • #11
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    BTW: That error was thrown after clicking on the Debug Button and previously clicking on console....

  • #12
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thx, so thats the error that is produced, but what should come is a popup with this content.
    When you said the links do not work, did you mean clicking the links results in to nothing happening or results to an empty window that means the Bootlog disappears what would mean the links are working as the console and help tabs are empty at the moment.

  • #13
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not getting any windows or popups and I just tried again with my popup blocker off but I knew that was not the problem since I never previously recieved an alert. All that happens when I click on console is the orginal box beneath that menu bar disappears and when I click on debug, I get that error.

    Like I orginally said. This probably has something to do with my security settings. I haven't bothered looking at the source but if you are using any type of Microsoft proprietary scripting, I have that blocked. If you are scripting cross domain, blocked. Loading into an iframe, blocked. Java, blocked....

    If noone else has reported these problems, I would not worry about it.


    .....Willy

  • #14
    Regular Coder
    Join Date
    Dec 2003
    Location
    America
    Posts
    544
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That sounds like quite a good idea, epecially if it will be able to tell you exactly what line the error is on and what specifically is wrong with the script. The default "Error On Page" generated by Internet Explorer usually isn't helpful, it does tell you the line and character and whats wrong, however a lot fo the time this isn't even correct, I've come across that a few times in the past and the error turned out to be something completely different. With the built in error message in Internet Explorer being about as helpful as a Japanese VCR instruction manual i'd imagine a few people will be interested in this.
    I totally agree. Additionally, what constitutes a line? Does it mean that the first first tag of a document is a line? Or a line from the actual script? Over-all, i agree with the fact that the debugger isnt very precise at all in telling us what exactly is the nature of the problem.
    LovesWar

  • #15
    New to the CF scene
    Join Date
    May 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The line is always the line of the file where the script is written in, so html-lines do count, but when the script isn't in the mainfile you will get the line of the scriptfile. Unhappilly due to a bug in IE you do not get the correct url always when getting a error message. I wrote my debugger to search all included script files and find the correct one and it seems to work allright. Out of that IE gives back the line after the error producing line usaly, so my script corrects that number, prints you the whole function code and highlights that line with the error. Furthermore it parses all objects in that line and checks wich elements could be wrong. So when you have eg alrt(document.all.frm.style.color); it will find out that alrt is not a valid object/function and it start checking the parts of document.all.frm.style.color from the first element to the last until there is an error (in this case document.all will be ok but then document.all.frm would be wrong). Just visit that links written before to see what I mean.


  •  

    Posting Permissions

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