We help IT Professionals succeed at work.

javascript debugger

Medium Priority
362 Views
Last Modified: 2013-12-16
I have some code that works with firefox, but not ie

I have the ms script debugger, but it comes up and won't display anything, it looks like it is having trouble opening.

Any suggestions?  It needs to be some sort of ie debugger since that is the only browser I have trouble with.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2004

Commented:
How much code is it?  We might be able to help if you post the bit that doesn't work?

Tim
President/Principal Consultant
Commented:
I use the following to get errors out of IE. Not perfect, but much better than the Script Debugger IMHO. Script Debugger can be a bear but it's url is http://www.google.com/url?sa=D&q=http:%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyId%3D2F465BE0-94FD-4569-B3C4-DFFDF19CCD99%26amp%3Bdisplaylang%3Den 

This first line must be at the top of the script. The function can be anywhere in JS. I normally just include them from a separate file. The result is that the error popup has the line number and message of the error.

onerror = handleErrors;
function handleErrors(errorMessage, url, line) {
  msg = "There was an error on this page.\n\n";
  msg += "An internal programming error may keep\n";
  msg += "this page from displaying properly.\n";
  msg += "Click OK to continue.\n\n";
  msg += "Error message: " + errorMessage + "\n";
  msg += "URL: " + url + "\n";
  msg += "Line #: " + line;
  alert(msg);
  return true;
}

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
thanks, is there any way to figure out what line number something is?
I know the javascript line errors that ie used to give didn't really correspond to anything good.

Would you suggest just viewing the source in a text editor and using their line numbers?
Stacy SpearPresident/Principal Consultant

Commented:
It uses the line numbering from the entire file. What are you editing the file with?

Author

Commented:
usually edit plus

It is mostly php, so my line numbers don't match with the html line numbers in any way.
Stacy SpearPresident/Principal Consultant

Commented:
:),

Same here with PHP. Looking at where the errors are on the generated page will provide clues as to where they are in your PHP code. I use Eclipse with the PHP addon. Pretty good with highlighting and more. It also is good for debugging as most errors are shown as such in code.

Author

Commented:
I have never heard of that, is it something I should use?

I pretty much hand code from scratch, I don't use any sort of generator at all.

Edit plus pretty much only highlights syntax, it is a way better version of notepad.

It doesn't really do too much other than that though.
Stacy SpearPresident/Principal Consultant

Commented:
PHP Eclipse does have intellisense. Eclipse is the most widely used editor around for Java, HTML, and perhaps soon PHP. www.eclipse.org

It is a hand coder. Although it is almost a full IDE, it isn't a WYSIWYG editor. I like it because as soon as I save, I can see the results in the browser on the IDE. So correcting errors goes by very fast. Before that I used PHP Designer 2005. Also freeware, it is pretty good too, but has some quircks. Overall, I think that Eclipse is better than all. I haven't used ZEND, but I hear complaints about it. Most of those are that it is a Java app, but so is Eclipse :)

Author

Commented:
thanks
Stacy SpearPresident/Principal Consultant

Commented:
Here is the link to the PHP Eclipse plugin

http://www.phpeclipse.de
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.