[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

javascript debugger

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.
0
jackjohnson44
Asked:
jackjohnson44
  • 5
  • 4
1 Solution
 
TimYatesCommented:
How much code is it?  We might be able to help if you post the bit that doesn't work?

Tim
0
 
Stacy SpearCommented:
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;
}
0
 
jackjohnson44Author 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?
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
Stacy SpearCommented:
It uses the line numbering from the entire file. What are you editing the file with?
0
 
jackjohnson44Author Commented:
usually edit plus

It is mostly php, so my line numbers don't match with the html line numbers in any way.
0
 
Stacy SpearCommented:
:),

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.
0
 
jackjohnson44Author 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.
0
 
Stacy SpearCommented:
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 :)
0
 
jackjohnson44Author Commented:
thanks
0
 
Stacy SpearCommented:
Here is the link to the PHP Eclipse plugin

http://www.phpeclipse.de
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now