Can I debugge Javascript code to see which values take my variables?
If so, How can I do it.
thanks so much
| SitePoint Sponsor |
Can I debugge Javascript code to see which values take my variables?
If so, How can I do it.
thanks so much

See http://javascript.about.com/od/probl...ipt-Debugging/ to see where to find the debugger option in whichever browser you are using.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">


If you're using Google Chrome, there are some highly specific details about using the JavaScript console at http://code.google.com/chrome/devtoo...s/console.html
Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript




If you're not comfortable using a debugger, another option is to insert alert() statements in your code to check values of variables or to check if parts of your code are ever reached.

Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">




If not using those browsers you can go to your Windows Task Manager (obviously if using Windows) to stop the process if it is stuck in an infinite loop.
Using chrome or firefox w/ firebug console.log() is probably the simplest means of dumping variables and testing code completion.
The only code I hate more than my own is everyone else's.

But that means crashing the entire browser - The way I suggested only crashes the script and leaves the rest of the web page and everything else in the browser intact.
So your suggestion is the equivalent of lopping off someone's head to get rid of a pimple on their nose.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">

Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">






Programming Group Advisor
Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
Car is to Carpet as Java is to JavaScript




I don't see the point you are making.
What I suggested is just another option which in my case with the way I do things, using the task manager is not an issue.
As I said in my previous post. If closing the browser is an issue for someone, then obviously closing the browser with the task manager is not an option - but for me it is![]()

Most people have more than one page open in their browser at the same time and your solution is to cancel all of them at once rather than just the page with the problem. That's the point being made - you are perhaps closing down four or five web sites that you had open just because of an issue with the one page. If one of those pages happened to be one where you were part way through a bank transaction then it could cost you a lot of money as well.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">




Now you're just resorting to posting fluff (which is against the rules)because all you are doing is repeating what paul_wilkins posted earlier and I replied with
What I suggested is just another option which in my case with the way I do things, using the task manager is not an issue.
As I said in my previous post. If closing the browser is an issue for someone, then obviously closing the browser with the task manager is not an option - but for me it is![]()
Bookmarks