Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #8955 > unrolled thread
| Started by | Gene Wirchenko <genew@ocis.net> |
|---|---|
| First post | 2011-12-06 18:32 -0800 |
| Last post | 2011-12-10 17:03 -0200 |
| Articles | 19 on this page of 39 — 14 participants |
Back to article view | Back to comp.lang.javascript
Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-06 18:32 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-07 08:43 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-07 10:16 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-08 21:28 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 14:36 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-08 22:39 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:10 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-09 10:13 +0000
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-08 23:41 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:15 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-09 08:59 +0000
Re: Silly Newbie Mistake Mike Duffy <Use_guestbook_page@website.in.sig> - 2011-12-09 13:03 +0000
Re: Silly Newbie Mistake Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-09 15:39 +0100
Re: Silly Newbie Mistake Mike Duffy <Use_guestbook_page@website.in.sig> - 2011-12-10 00:40 +0000
Re: Silly Newbie Mistake Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-12-10 13:19 +0100
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-09 15:13 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-09 10:01 -0800
Re: Silly Newbie Mistake "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-12-10 15:07 +0000
Re: Silly Newbie Mistake Norman Peelman <npeelmandog@cfl.rr.com> - 2011-12-09 06:44 -0500
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-09 10:04 -0800
Re: Silly Newbie Mistake Steve Wakeford <wakeford83@gmail.com> - 2011-12-07 05:40 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-07 15:35 +0000
Re: Silly Newbie Mistake Jacob Block <jacob.block@gmail.com> - 2011-12-07 09:20 -0800
Re: Silly Newbie Mistake Jacob Block <jacob.block@gmail.com> - 2011-12-07 09:25 -0800
Re: Silly Newbie Mistake Richard Cornford <Richard@litotes.demon.co.uk> - 2011-12-08 03:56 -0800
Re: Silly Newbie Mistake "Mel Smith" <med_cutout_syntel@aol.com> - 2011-12-08 11:31 -0700
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 11:49 -0800
Re: Silly Newbie Mistake Tim Streater <timstreater@greenbee.net> - 2011-12-08 21:35 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:22 -0800
Re: Silly Newbie Mistake Richard Cornford <Richard@litotes.demon.co.uk> - 2011-12-09 05:04 -0800
Re: Silly Newbie Mistake Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-09 21:07 +0000
Re: Silly Newbie Mistake Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2011-12-09 09:47 +1100
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:26 -0800
Re: Silly Newbie Mistake Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2011-12-09 12:47 +1100
Re: Silly Newbie Mistake Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-08 19:40 +0000
Re: Silly Newbie Mistake Gene Wirchenko <genew@ocis.net> - 2011-12-08 17:24 -0800
Re: Silly Newbie Mistake Dr J R Stockton <reply1149@merlyn.demon.co.uk> - 2011-12-10 23:41 +0000
Re: Silly Newbie Mistake kiran <kiranmbadi@gmail.com> - 2011-12-08 17:18 -0800
Re: Silly Newbie Mistake "J.R." <groups_jr-1@yahoo.com.br> - 2011-12-10 17:03 -0200
Page 2 of 2 — ← Prev page 1 [2]
| From | Steve Wakeford <wakeford83@gmail.com> |
|---|---|
| Date | 2011-12-07 05:40 -0800 |
| Message-ID | <7275566.278.1323265235487.JavaMail.geo-discussion-forums@yqkp3> |
| In reply to | #8955 |
If you can use Firefox there is a great add-on called FireBug http://getfirebug.com/ It has an integrated line debugger with support for breakpoints, watch expressions, visible call stack. It also can be just as simple as outputting the JavaScript error that halted script execution, usually this will be all you need. Great plugin and definitely industry standard for web development.
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2011-12-07 15:35 +0000 |
| Message-ID | <timstreater-286699.15353107122011@news.individual.net> |
| In reply to | #8963 |
In article <7275566.278.1323265235487.JavaMail.geo-discussion-forums@yqkp3>, Steve Wakeford <wakeford83@gmail.com> wrote: > If you can use Firefox there is a great add-on called FireBug > http://getfirebug.com/ > > It has an integrated line debugger with support for breakpoints, watch > expressions, visible call stack. It also can be just as simple as outputting > the JavaScript error that halted script execution, usually this will be all > you need. Great plugin and definitely industry standard for web development. For JavaScript debugging, I've never needed much more than the use of alert(), or more conveniently console.info(), which puts messages into Safari's error console. Safari also allows you to inspect any element which includes all the attributes and styles for the element and where the computed style comes from. You can also modify an element to see the effect of style or attribute changes. But you also have to think what you're doing. The other day I looked at some of my code and thought, hey, I can optimise that by using getElementById() to look for the element by id. But it didn't work. Then I remembered why I'd coded it to look through the rows by hand: the tbody I was searching through was not part of the DOM, so I can't use getElementById() for that one. -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | Jacob Block <jacob.block@gmail.com> |
|---|---|
| Date | 2011-12-07 09:20 -0800 |
| Message-ID | <253f252a-d8b3-42d8-86f9-e2405294efaf@v6g2000yqv.googlegroups.com> |
| In reply to | #8955 |
On Dec 6, 9:32 pm, Gene Wirchenko <ge...@ocis.net> wrote: > Dear JavaScripters: > > At the best of time, I have found debugging JavaScript code to be > such a bother. I have been using IE's F12, but it does not handle (or > I have not figured out how) debugging an included file (<script > src=...). (If you know how, would you please let me know?) As a > consequence, I did not get immediate feedback on my silly error and > wasted a couple of hours. > > You see, I have done a lot of programming in Visual FoxPro. Its > line comment token is "&&". Somehow, I typed that, instead of "//", > and I did not see it as an error for some time. > > Go ahead and laugh, but it could be you next time. > > Sincerely, > > Gene Wirchenko I really like using Google Chrome's web tools. Just hit ctrl+shift+I and you can look at scripts, set breakpoints and reload and trace through programs. It gives you great information in tool-tips on all variables and you can do some fancier stuff too. I am new at Javascript and was wondering if there is anything better than developing just in Chrome too (yeah I've tried Firefox's plugins, but they don't seem as fluid). Based on these replies it seems like there isn't. I have experience with Eclipse and haven't really looked in to doing web development in it. I know there are some plugins, but Chrome just seemed easier for the small stuff I've been doing. Jacob
[toc] | [prev] | [next] | [standalone]
| From | Jacob Block <jacob.block@gmail.com> |
|---|---|
| Date | 2011-12-07 09:25 -0800 |
| Message-ID | <a96d2964-a252-4179-9bde-6f2878f7a7f8@d17g2000yql.googlegroups.com> |
| In reply to | #8955 |
On Dec 6, 9:32 pm, Gene Wirchenko <ge...@ocis.net> wrote: > Dear JavaScripters: > > At the best of time, I have found debugging JavaScript code to be > such a bother. I have been using IE's F12, but it does not handle (or > I have not figured out how) debugging an included file (<script > src=...). (If you know how, would you please let me know?) As a > consequence, I did not get immediate feedback on my silly error and > wasted a couple of hours. > > You see, I have done a lot of programming in Visual FoxPro. Its > line comment token is "&&". Somehow, I typed that, instead of "//", > and I did not see it as an error for some time. > > Go ahead and laugh, but it could be you next time. > > Sincerely, > > Gene Wirchenko I should also add that you can monitor HTML and javascript in real- time. I was reviewing a JQuery plugin slideshow plugin and HTML tags were popping up and disappearing as I was doing the hovering. I thought that was really cool/helpful. Not sure if other environments can handle that. You can also make changes in real-time like someone above mentioned of Firefox. Definitely check it out! Jacob
[toc] | [prev] | [next] | [standalone]
| From | Richard Cornford <Richard@litotes.demon.co.uk> |
|---|---|
| Date | 2011-12-08 03:56 -0800 |
| Message-ID | <406b3f7c-66d2-45b4-96c1-6be1153efcce@l19g2000yqc.googlegroups.com> |
| In reply to | #8955 |
On Dec 7, 2:32 am, Gene Wirchenko wrote: > Dear JavaScripters: > > At the best of time, I have found debugging JavaScript code > to be such a bother. It gets easier. There is an inevitably (because we are dealing with machines) close relationship between the error messages generated by javascript engines so eventually the specific message text will pretty much tell you what you need to be looking for (and where), which makes it fairly trivial to find and fix it. > I have been using IE's F12, but it does not handle (or > I have not figured out how) debugging an included file (<script > src=...). Not being able to debug included resources would be so useless for a javascript debugger that this extremely unlikely to be the case. > (If you know how, would you please let me know?) As a > consequence, I did not get immediate feedback on my silly > error and wasted a couple of hours. But your "silly error" was (almost certainly) a syntax error, so if set up to do so IE would have popped up its error dialog as soon as it spotted the syntax error. Trying to develop on IE while not having pop- up its error dialog for every error will waste a great deal of time. > You see, I have done a lot of programming in Visual FoxPro. > Its line comment token is "&&". Somehow, I typed that, instead > of "//", and I did not see it as an error for some time. That type of mistake is pretty common. The version I have seen most often has been people used to writing VBScript trying to use its comment delimiter in javascript. That is always going to be a syntax error, but even though your - && - is a javascript operator it is still unlikely that you could both semicolon terminate the statement being commented on and/or write a worthwhile comment without the result being a syntax error. Remember that a syntax error will be identified when the code is parsed, the result will never be executable, and so a debugger, as such, will be of no use in identifying that problem because it will not have anything executable to work with. > Go ahead and laugh, but it could be you next time. Mistakes are inevitable, but syntax errors are not that difficult to find and fix. Richard.
[toc] | [prev] | [next] | [standalone]
| From | "Mel Smith" <med_cutout_syntel@aol.com> |
|---|---|
| Date | 2011-12-08 11:31 -0700 |
| Message-ID | <9kce3cF7hpU1@mid.individual.net> |
| In reply to | #8979 |
Hi:
I too use IE (actually IE7) as my test bed because my small set of users
are older people with IE as the browser.
In any case, *my* error was using the assignment operator := instead
of =
(altho I have used FoxBase, FoxPlus, and later FoxPro, for the last ten
years I've used Harbour/xHarbour for web site development. This language
uses := as the assignment operator.)
I spent two hours wondering why nothing was happening as I modified code
in my Javascript. Even the Alert() messages were not displaying.
After *finally* locating this faulty assignment operator and correcting
it, my javascript started working again.
So, altho I have Chrome and FF on my dev machine, I do most of my
primary development using IE and Javascript.
I guess I'll have to use more Chrome or FF for development.
(but again, the biggest confusion is syntactic because my language is so
much like Javascript, but again different in many small ways -- and I
program in both languages every day -- a brain buster !)
-Mel Smith
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 11:49 -0800 |
| Message-ID | <3u42e7d2uq84hj3hnqjs2o774lk0dh1mt2@4ax.com> |
| In reply to | #8979 |
On Thu, 8 Dec 2011 03:56:38 -0800 (PST), Richard Cornford
<Richard@litotes.demon.co.uk> wrote:
>On Dec 7, 2:32 am, Gene Wirchenko wrote:
>> Dear JavaScripters:
>>
>> At the best of time, I have found debugging JavaScript code
>> to be such a bother.
>
>It gets easier. There is an inevitably (because we are dealing with
>machines) close relationship between the error messages generated by
>javascript engines so eventually the specific message text will pretty
>much tell you what you need to be looking for (and where), which makes
>it fairly trivial to find and fix it.
I am not getting error messages. I simply get no page display.
This makes tracking down errors considerably more difficult and
time-consuming.
>> I have been using IE's F12, but it does not handle (or
>> I have not figured out how) debugging an included file (<script
>> src=...).
>
>Not being able to debug included resources would be so useless for a
>javascript debugger that this extremely unlikely to be the case.
The probability is 1. Note that I stipulated "(or I have not
figured out how)". A feature that I can not figure out how to use
might as well not exist. How does it work?
>> (If you know how, would you please let me know?) As a
>> consequence, I did not get immediate feedback on my silly
>> error and wasted a couple of hours.
>
>But your "silly error" was (almost certainly) a syntax error, so if
>set up to do so IE would have popped up its error dialog as soon as it
>spotted the syntax error. Trying to develop on IE while not having pop-
>up its error dialog for every error will waste a great deal of time.
Yes. I have looked. Where is that setting?
>> You see, I have done a lot of programming in Visual FoxPro.
>> Its line comment token is "&&". Somehow, I typed that, instead
>> of "//", and I did not see it as an error for some time.
>
>That type of mistake is pretty common. The version I have seen most
>often has been people used to writing VBScript trying to use its
>comment delimiter in javascript. That is always going to be a syntax
>error, but even though your - && - is a javascript operator it is
>still unlikely that you could both semicolon terminate the statement
>being commented on and/or write a worthwhile comment without the
>result being a syntax error.
Which is not reported on my system.
>Remember that a syntax error will be identified when the code is
>parsed, the result will never be executable, and so a debugger, as
>such, will be of no use in identifying that problem because it will
>not have anything executable to work with.
>
>> Go ahead and laugh, but it could be you next time.
>
>Mistakes are inevitable, but syntax errors are not that difficult to
>find and fix.
They can be if the error is not reported.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2011-12-08 21:35 +0000 |
| Message-ID | <timstreater-8433D9.21350908122011@news.individual.net> |
| In reply to | #8995 |
In article <3u42e7d2uq84hj3hnqjs2o774lk0dh1mt2@4ax.com>, Gene Wirchenko <genew@ocis.net> wrote: [snip] > I am not getting error messages. I simply get no page display. > This makes tracking down errors considerably more difficult and > time-consuming. [snip] > They can be if the error is not reported. No decent browser is going to detect an syntax error, and then not report it. I just tried a small test, adding this: +=25 in the page load handler. In Safari's case, I see (in the Error Console) the message: Syntax Error: unexpected token +=25 FF gives a similar message. If in your case the page isn't being loaded you might have no syntax error, instead a logic error that means what you think is a pointer to some DOM item is in fact null, and execution stops right there (I'm assuming your JS loads the page, otherwise you'd see it - in my error case the page load completes but because JS execution doesn't, various buttons are not disabled as normal). Have you looked in the FF error console? (Tools -> Web Developer -. Error Console) -- Tim "That excessive bail ought not to be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 17:22 -0800 |
| Message-ID | <tao2e7574dvnff94ahu35tfv4c0o3jgtc6@4ax.com> |
| In reply to | #8997 |
On Thu, 08 Dec 2011 21:35:09 +0000, Tim Streater
<timstreater@greenbee.net> wrote:
>In article <3u42e7d2uq84hj3hnqjs2o774lk0dh1mt2@4ax.com>,
> Gene Wirchenko <genew@ocis.net> wrote:
>
>[snip]
>
>> I am not getting error messages. I simply get no page display.
>> This makes tracking down errors considerably more difficult and
>> time-consuming.
>
>[snip]
>
>> They can be if the error is not reported.
>
>No decent browser is going to detect an syntax error, and then not
>report it.
I am using IE 9. I do not care if you consider it then to be not
a decent browser. It is the one that I have to use. I think it
highly likely that it can report errors, but I am not getting that.
[snip]
>If in your case the page isn't being loaded you might have no syntax
>error, instead a logic error that means what you think is a pointer to
>some DOM item is in fact null, and execution stops right there (I'm
>assuming your JS loads the page, otherwise you'd see it - in my error
>case the page load completes but because JS execution doesn't, various
>buttons are not disabled as normal).
There are those sorts of errors at times, too, but I have
execution stopping dead due to syntax errors.
>Have you looked in the FF error console? (Tools -> Web Developer -.
>Error Console)
As stated previously, I am using IE 9. I have seen the F12
tools, but they do not work reliably for me (or I am missing
something).
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Richard Cornford <Richard@litotes.demon.co.uk> |
|---|---|
| Date | 2011-12-09 05:04 -0800 |
| Message-ID | <29b73606-1ad0-4dcb-b084-d53d99f9a2bb@i6g2000vbh.googlegroups.com> |
| In reply to | #8995 |
On Dec 8, 7:49 pm, Gene Wirchenko wrote: > On Thu, 8 Dec 2011 03:56:38 -0800 (PST), Richard Cornford >>On Dec 7, 2:32 am, Gene Wirchenko wrote: >>> Dear JavaScripters: > >>> At the best of time, I have found debugging JavaScript code >>> to be such a bother. > >> It gets easier. There is an inevitably (because we are dealing with >> machines) close relationship between the error messages generated >> by javascript engines so eventually the specific message text will >> pretty much tell you what you need to be looking for (and where), >> which makes it fairly trivial to find and fix it. > > I am not getting error messages. I simply get no page display. "No page display", if taken literally, sounds more like a problem with HTML or the browser's ability to access the page. Obviously if either of those where the case then there is no chance of any javascript executing at all, so there won't even be syntax errors. > This makes tracking down errors considerably more difficult and > time-consuming. The difficult and time consuming part is learning how things should work and how to verify when/that they are. "No page display" is such an extreme symptom that it won't have more than a dozen or so possible causes, which would come into play in a certain order and so can be tested for and either eliminated or identified as pertinent with a shortish sequence of tests. >>> I have been using IE's F12, but it does not handle (or >>> I have not figured out how) debugging an included file (<script >>> src=...). > >> Not being able to debug included resources would be so useless >> for a javascript debugger that this extremely unlikely to be >> the case. > > The probability is 1. The probability of what exactly? > Note that I stipulated "(or I have not figured out how)". I noticed, and it struck me as likely to be the case here. > A feature that I can not figure out how to use > might as well not exist. True, but it is unlikely that the limits of your comprehension will be restrictive in this context. > How does it work? > >>> (If you know how, would you please let me know?) As a >>> consequence, I did not get immediate feedback on my silly >>> error and wasted a couple of hours. > >> But your "silly error" was (almost certainly) a syntax error, so >> if set up to do so IE would have popped up its error dialog as >> soon as it spotted the syntax error. Trying to develop on IE >> while not having pop-up its error dialog for every error will >> waste a great deal of time. > > Yes. I have looked. Where is that setting? <snip> Tools->Internet Options...->Advanced(tab)->Settings(list)- >Browsing(sublist)->Display a notification about every script error(checkbox); should be checked, and also any "Disable script debugging" checkboxes above it (these checkboxes don't refer to F12 debugging, apparently). Richard.
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1149@merlyn.demon.co.uk> |
|---|---|
| Date | 2011-12-09 21:07 +0000 |
| Message-ID | <THLbIkJ2hn4OFwQ6@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #8995 |
In comp.lang.javascript message <3u42e7d2uq84hj3hnqjs2o774lk0dh1mt2@4ax. com>, Thu, 8 Dec 2011 11:49:04, Gene Wirchenko <genew@ocis.net> posted: > I am not getting error messages. I simply get no page display. >This makes tracking down errors considerably more difficult and >time-consuming. The biggest mistake made by beginners, and you are manifestly a beginner here, whatever else you may have done before, is to change too much between tests. If, between two tests, you only change one line of code (keeping the old line as comment), then, when it no longer does what you expect, the fault must have something to do with the difference between the two lines. Another general trick, in a language where undeclared variables are permissible, is to write "banana" just after the new part (assuming that you are not programming vegetably). You know then that you should be getting an error message (unless you have written an infinite loop); and, if it is banana, at least your code above had a measure of acceptability. That also serves to prevent subsequent code interfering with any visible evidence that there may be. -- (c) John Stockton, nr London UK. replyYYWW merlyn demon co uk Turnpike 6.05. Web <http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A. Web <http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News. No Encoding. Quotes precede replies. Snip well. Write clearly. Mail no News. .
[toc] | [prev] | [next] | [standalone]
| From | Ross McKay <au.org.zeta.at.rosko@invalid.invalid> |
|---|---|
| Date | 2011-12-09 09:47 +1100 |
| Message-ID | <rfe2e7pddnushl2uht2ls5218at833kpg2@4ax.com> |
| In reply to | #8955 |
On Tue, 06 Dec 2011 18:32:58 -0800, Gene Wirchenko wrote: > At the best of time, I have found debugging JavaScript code to be >such a bother. I have been using IE's F12, but it does not handle (or >I have not figured out how) debugging an included file (<script >src=...). (If you know how, would you please let me know?) As a >consequence, I did not get immediate feedback on my silly error and >wasted a couple of hours. I highly recommend you learn JavaScript in either Firefox with the Firebug extension[1] or Google Chrome. The debugging tools are much better. I guess you can also throw in Opera, as Dragonfly is pretty good too (but slower on starting). Just load the page once, navigate to the included scripts in the debugger, set your breakpoints, then reload. Keep IE's tools for debugging IE-specific problems. Also learn how to make good use of the console logging tools.[2][3] > You see, I have done a lot of programming in Visual FoxPro. Its >line comment token is "&&". Somehow, I typed that, instead of "//", >and I did not see it as an error for some time. You might find greater happiness (less Risk!) in returning to an edit / "compile" / test cycle, where "compile" is actually a lint pass to check for such basic mistakes.[4][5] You'll probably need to tinker with the config files to suppress some screaming though, as linters can be excessively fussy at times :) [1] https://addons.mozilla.org/en-US/firefox/addon/firebug/ [2] https://developer.mozilla.org/en/Using_the_Web_Console [3] http://getfirebug.com/wiki/index.php/Console_API [4] http://www.jslint.com/ [5] http://www.javascriptlint.com/ -- Ross McKay, Toronto, NSW Australia "Let the laddie play wi the knife - he'll learn" - The Wee Book of Calvin
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 17:26 -0800 |
| Message-ID | <0so2e7tqelroi317nt7lafpv2nm5bqm2rm@4ax.com> |
| In reply to | #9002 |
On Fri, 09 Dec 2011 09:47:00 +1100, Ross McKay
<au.org.zeta.at.rosko@invalid.invalid> wrote:
>On Tue, 06 Dec 2011 18:32:58 -0800, Gene Wirchenko wrote:
>
>> At the best of time, I have found debugging JavaScript code to be
>>such a bother. I have been using IE's F12, but it does not handle (or
>>I have not figured out how) debugging an included file (<script
>>src=...). (If you know how, would you please let me know?) As a
>>consequence, I did not get immediate feedback on my silly error and
>>wasted a couple of hours.
>
>I highly recommend you learn JavaScript in either Firefox with the
>Firebug extension[1] or Google Chrome. The debugging tools are much
>better. I guess you can also throw in Opera, as Dragonfly is pretty good
>too (but slower on starting). Just load the page once, navigate to the
>included scripts in the debugger, set your breakpoints, then reload.
I do not have the option. The company standard is IE.
[snip]
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Ross McKay <au.org.zeta.at.rosko@invalid.invalid> |
|---|---|
| Date | 2011-12-09 12:47 +1100 |
| Message-ID | <hsp2e7lnga3hu4muvu73qeaqllqp9cg7c7@4ax.com> |
| In reply to | #9015 |
On Thu, 08 Dec 2011 17:26:32 -0800, Gene Wirchenko wrote: > I do not have the option. The company standard is IE. Which is fine when you know what you are doing, but while you are learning the language you should use good learning tools -- the IE developer tools are passable for debugging real like IE problems, but you should not be writing solely for IE9 (lock in anyone?) and you will get better diagnostic information from Firefox+Firebug and Google Chrome. Also, a JS lint tool does not care about what browser you are using, it looks at your source files: >>You might find greater happiness (less Risk!) in returning to an edit / >>"compile" / test cycle, where "compile" is actually a lint pass to check >>for such basic mistakes.[4][5] You'll probably need to tinker with the >>config files to suppress some screaming though, as linters can be >>excessively fussy at times :) >>[...] >>[4] http://www.jslint.com/ >>[5] http://www.javascriptlint.com/ -- Ross McKay, Toronto, NSW Australia "If ye cannae see the bottom, dinnae complain if ye droon" - The Wee Book of Calvin
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1149@merlyn.demon.co.uk> |
|---|---|
| Date | 2011-12-08 19:40 +0000 |
| Message-ID | <5ioBxgF7KR4OFwWv@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #8955 |
In comp.lang.javascript message <nojtd7pb39ofku9j7a1bi6pog635kga2ua@4ax. com>, Tue, 6 Dec 2011 18:32:58, Gene Wirchenko <genew@ocis.net> posted: > At the best of time, I have found debugging JavaScript code to be >such a bother. I have been using IE's F12, but it does not handle (or >I have not figured out how) debugging an included file (<script >src=...). (If you know how, would you please let me know?) As a >consequence, I did not get immediate feedback on my silly error and >wasted a couple of hours. But we here are smarter, and so use other browsers. Note that the reported market share for other browsers is now considerably greater than that for IE. Of course, once the author's sillies have been dealt with by using other browsers, one should use IE and try to deal with its sillies. For code not reliant on a GUI and I/O, it may well be worth testing in JScript under WSH. That at least gives a clear indication, in your choice of font size, of where it thinks the error is or becomes detectable. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike 6.05 WinXP. Web <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links. Command-prompt MiniTrue is useful for viewing/searching/altering files. Free, DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2011-12-08 17:24 -0800 |
| Message-ID | <lmo2e757mar0dn9vgb1osnhmh98fl5lj14@4ax.com> |
| In reply to | #9004 |
On Thu, 8 Dec 2011 19:40:43 +0000, Dr J R Stockton
<reply1149@merlyn.demon.co.uk> wrote:
>In comp.lang.javascript message <nojtd7pb39ofku9j7a1bi6pog635kga2ua@4ax.
>com>, Tue, 6 Dec 2011 18:32:58, Gene Wirchenko <genew@ocis.net> posted:
>
>> At the best of time, I have found debugging JavaScript code to be
>>such a bother. I have been using IE's F12, but it does not handle (or
>>I have not figured out how) debugging an included file (<script
>>src=...). (If you know how, would you please let me know?) As a
>>consequence, I did not get immediate feedback on my silly error and
>>wasted a couple of hours.
>
>But we here are smarter, and so use other browsers.
I prefer Firefox myself, but company standard is IE.
>Note that the reported market share for other browsers is now
>considerably greater than that for IE.
IE still has a considerable plurality, not that that makes a
difference to me. The company standard is IE.
>Of course, once the author's sillies have been dealt with by using other
>browsers, one should use IE and try to deal with its sillies.
I will be developing a complex system in IE. I need to learn it
inside out.
>For code not reliant on a GUI and I/O, it may well be worth testing in
>JScript under WSH. That at least gives a clear indication, in your
>choice of font size, of where it thinks the error is or becomes
>detectable.
??? How would a Webpage not be reliant on I/O?
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1149@merlyn.demon.co.uk> |
|---|---|
| Date | 2011-12-10 23:41 +0000 |
| Message-ID | <8Y9gv9Su4+4OFwly@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #9014 |
In comp.lang.javascript message <lmo2e757mar0dn9vgb1osnhmh98fl5lj14@4ax.
com>, Thu, 8 Dec 2011 17:24:58, Gene Wirchenko <genew@ocis.net> posted:
>On Thu, 8 Dec 2011 19:40:43 +0000, Dr J R Stockton
><reply1149@merlyn.demon.co.uk> wrote:
>
>>In comp.lang.javascript message <nojtd7pb39ofku9j7a1bi6pog635kga2ua@4ax.
>>com>, Tue, 6 Dec 2011 18:32:58, Gene Wirchenko <genew@ocis.net> posted:
>>
>>> At the best of time, I have found debugging JavaScript code to be
>>>such a bother. I have been using IE's F12, but it does not handle (or
>>>I have not figured out how) debugging an included file (<script
>>>src=...). (If you know how, would you please let me know?) As a
>>>consequence, I did not get immediate feedback on my silly error and
>>>wasted a couple of hours.
>>
>>But we here are smarter, and so use other browsers.
>
> I prefer Firefox myself, but company standard is IE.
That suggests that you have access to Firefox. If the company allows
you to install Firefox at work, do so, and use it as a debugger.
Otherwise, install Firefox at home, and practice there until you can
write code that has a chance of running in IE.
>>Note that the reported market share for other browsers is now
>>considerably greater than that for IE.
>
> IE still has a considerable plurality, not that that makes a
>difference to me. The company standard is IE.
Perhaps you should have chosen a wiser company.
>>Of course, once the author's sillies have been dealt with by using other
>>browsers, one should use IE and try to deal with its sillies.
>
> I will be developing a complex system in IE. I need to learn it
>inside out.
If your coding is for an intranet, or otherwise not exposed to the Great
World Outside, then it would be well to say so, in each new thread at
least. Otherwise, that is a ludicrous, if common, policy, worthy of the
more obstinate governments of lower latitudes.
>>For code not reliant on a GUI and I/O, it may well be worth testing in
>>JScript under WSH. That at least gives a clear indication, in your
>>choice of font size, of where it thinks the error is or becomes
>>detectable.
Then you will need to distinguish between its peculiar ideas, which you
will have to live with until IE 10 (when they will change) and your own
inaccurate ideas, which can be corrected when discovered.
> ??? How would a Webpage not be reliant on I/O?
I wrote "code", not "webpage". It is quite possible to have chunks of
code which manipulate data, without storing them. A simple but
unrealistic illustration would be if you had to sort, into chronological
order, a set of strings each starting with a date/time formatted as in
Sat Dec 10 2034 09:46:05 a.m.
(which is the sort of thing that Middle North Americans like), and it
had to be done without using the Date Object.
That task requires no I/O, and temporary debugging I/O can use
WScript.echo.
--
(c) John Stockton, nr London UK ?@merlyn.demon.co.uk IE8 FF8 Op11 Sf5 Cr15
news:comp.lang.javascript FAQ <http://www.jibbering.com/faq/index.html>.
<http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
[toc] | [prev] | [next] | [standalone]
| From | kiran <kiranmbadi@gmail.com> |
|---|---|
| Date | 2011-12-08 17:18 -0800 |
| Message-ID | <7912542.1865.1323393506452.JavaMail.geo-discussion-forums@yqim9> |
| In reply to | #8955 |
LOL I am already there.
[toc] | [prev] | [next] | [standalone]
| From | "J.R." <groups_jr-1@yahoo.com.br> |
|---|---|
| Date | 2011-12-10 17:03 -0200 |
| Message-ID | <jc0aej$j2l$1@speranza.aioe.org> |
| In reply to | #8955 |
On 07/12/2011 00:32, Gene Wirchenko wrote: > Dear JavaScripters: > > At the best of time, I have found debugging JavaScript code to be > such a bother. I have been using IE's F12, but it does not handle (or > I have not figured out how) debugging an included file (<script > src=...). (If you know how, would you please let me know?) As a > consequence, I did not get immediate feedback on my silly error and > wasted a couple of hours. Of course, you haven't figured it out. Check this out: <http://msdn.microsoft.com/en-us/library/gg699336(v=vs.85).aspx> MSDN has loads of information concerning the F12 Developer Tools: <http://msdn.microsoft.com/en-us/library/gg589500(v=vs.85).aspx> Cheers, Joao Rodrigues (J.R.) > > You see, I have done a lot of programming in Visual FoxPro. Its > line comment token is "&&". Somehow, I typed that, instead of "//", > and I did not see it as an error for some time. > > Go ahead and laugh, but it could be you next time.
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.javascript
csiph-web