By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

Related to frustrations below

P: n/a
As noted before, I'm not a JS programmer, but I ought to be able to get
a couple simple things done with it and now I've spent two weeks on them.

Main reasons:
- seems like JS is all-or-nothing. When I have a bug, the entire page is
blank.
- javascript console isn't outputting anything, so my current method of
finding bugs is to comment out every line in the script until i find the
one that makes the screen go blank. This was fun the first couple times,
but no longer.

So could anyone answer:
-what kind(s) of error make it so that JS won't compile. In my example
problem below this line:
options_total = +form.options_total.value;
results in a blank screen. as does
options_total = +document.form.options_total.value;
I find this surprising. If those ref's are no good, or the values are
blank, or not strings, I can fix that. But why would my whole interface
just not appear?

-Old versions of IE that I used would show an exclamation point in the
bottom-left, and you could read details on JS errors. This isn't
appearing. And in firefox, the Javascript Console isn't outputting
anything. Not even if I include the line:
I'm fat;

Really
Oct 7 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I was able to see some console output by setting
javascript.options.strict in about:config

what i see now are tons of warnings, mostly to do with undefined
variables, so I'm going to look in there...
What does "variable _____ hides argument" mean?
Oct 7 '05 #2

P: n/a
Matthew Crouch <ma************@spamlessverizon.net> wrote:
- seems like JS is all-or-nothing. When I have a bug, the entire page is
blank.
More or less.
- javascript console isn't outputting anything, so my current method of
finding bugs is to comment out every line in the script until i find the
one that makes the screen go blank. This was fun the first couple times,
but no longer.
If you use a decent browser, you can use window.onerror to catch
most errors and get some information about what line the compiler
things the error occurred on. It isn't always helpful, but the times
that it is are sweet indeed.
I find this surprising. If those ref's are no good, or the values are
blank, or not strings, I can fix that. But why would my whole interface
just not appear?
Because you didn't catch the resulting exception; try/catch can also
improve your life dramatically, and they give you a chance to try to
recover from the error and go on semi-normally. If the exception
makes it up to the browser without being caught, your script execution
is basically done.
-Old versions of IE that I used would show an exclamation point in the
bottom-left, and you could read details on JS errors. This isn't
appearing. And in firefox, the Javascript Console isn't outputting
anything. Not even if I include the line:
I'm fat;


Firefox clearly is complimenting you on your svelte figure. That
aside, check to see that IE is configured to alert you to every script
error. I can't tell you why Firefox isn't displaying the console; I
actually have yet to have a need for it.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Oct 7 '05 #3

P: n/a
On 07/10/2005 17:17, Matthew Crouch wrote:
I was able to see some console output by setting
javascript.options.strict in about:config
I've never used it, but a reliable source would suggest that some
warnings issued from the use of this option can be misleading at best,
and bogus at worst. Be careful.
what i see now are tons of warnings, mostly to do with undefined
variables, so I'm going to look in there...
It's generally considered a good idea to declare all variables
explicitly using the var statement, even though it's not necessary with
globals.
What does "variable _____ hides argument" mean?


I would have to guess that you've written something like:

function(myArgument) {
var myArgument;
}

However, if this is the case, then this is one of those bogus warnings
because the var statement above is effectively ignored; the argument
itself takes precedence.

The only way to 'hide' an argument is to create an inner function
declaration or assign to that argument. Both would replace its value,
but only the first (at most) would deserve notice.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Oct 7 '05 #4

P: n/a
Michael Winter <m.******@blueyonder.co.uk> wrote:
I've never used it, but a reliable source would suggest that some
warnings issued from the use of this option can be misleading at best,
and bogus at worst. Be careful.


Better or worse than jslint?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Oct 7 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.