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

"error on page"

P: n/a
How do you track down this to where the error actually is?

TIA, Lee
Jul 23 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Depends on the browser,
in Internet Explorer for instance, you can double click
on the error icon: left-lower corner, and view the details ...

Jul 23 '05 #2

P: n/a
Lee David said the following on 7/21/2005 4:46 PM:
How do you track down this to where the error actually is?


You read the error message. It states what the error is and what line it
is on. To see the error message, in IE, you double click the Yellow !,
in Mozilla you go Tools>Web Development>Javascript Console.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #3

P: n/a
Thank you. When I reopened the page it lead me directly to the "operator
error" (my mistake) of not knowing how to spell "document" correctly. Now I
just need to find out how to get the Netscape browser identified. This
didn't work:

if (document.layers)
{
alert("**testing** NS");
var ns4test = true;
var ie4test = false;
}

Nor did the more compact:
ns4test = document.layers?true:false;

Again, thanks for the quick response... I'll put my shoe down and the
monitor is safe again.

Lee

"frizzle" <ph********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Depends on the browser,
in Internet Explorer for instance, you can double click
on the error icon: left-lower corner, and view the details ...

Jul 23 '05 #4

P: n/a
Lee David said the following on 7/21/2005 6:36 PM:
Thank you. When I reopened the page it lead me directly to the "operator
error" (my mistake) of not knowing how to spell "document" correctly. Now I
just need to find out how to get the Netscape browser identified. This
didn't work:
Why does it matter if its Netscape, Mozilla, FunkyBrowser or
myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.
if (document.layers)
{
alert("**testing** NS");
var ns4test = true;
var ie4test = false;
}

Nor did the more compact:
ns4test = document.layers?true:false;
That actually "works", it just doesn't work the way you think it would.
Again, thanks for the quick response... I'll put my shoe down and the
monitor is safe again.


if (document.layers){
//use the document.layers collection
}

if (document.getElementByID){
//use the getElementByID method
}

if (document.all){
//use the document.all collection
}

And all that without caring what browser it was. This is covered in the
groups FAQ.

And please don't top-post.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #5

P: n/a
Lee David wrote:
[...]

Nor did the more compact:
ns4test = document.layers?true:false;


For the sake of the exercise:

var supportForLayers = !!document.layers;

The use of !! forces the result to be explicitly true or false and have
the right sense.
[...]

--
Rob
Jul 23 '05 #6

P: n/a
> For the sake of the exercise:

var supportForLayers = !!document.layers;

The use of !! forces the result to be explicitly true or false and have
the right sense.


I'm using <div> to enclose the text that I want to appear. I understand
that Layers is an older and not needed technology. However, the check for
it indicates the usage of NS which used totally different values than IE
does. Therefore, I'm assuming I could use the above and then have code like
this:

if (supportForLayers)
{
turn on the various <div> based on which object incurred the mouseover or
mouseout event using "show"
turn off the various <div> that are not applicable to the triggering event
using "hide"
}

if (supportForAll)
{
turn on the various <div> based on which object incurred the mouseover or
mouseout event using "visible"
turn off the various <div> that are not applicable to the triggering event
using "hidden"
}

Would I need something for Opera, Firefox or other modzilla browsers?

Thanks, Lee
Jul 23 '05 #7

P: n/a
>
Why does it matter if its Netscape, Mozilla, FunkyBrowser or
myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.

Because specific browsers have specific and unique values such as Netscape's
"show" vs. the IE "visible."

That actually "works", it just doesn't work the way you think it would.

Could you elaborate on how it is working vs. how it would be expected to?

if (document.layers){
//use the document.layers collection
}

if (document.getElementByID){
//use the getElementByID method
}

if (document.all){
//use the document.all collection
}

And all that without caring what browser it was. This is covered in the
groups FAQ.


I've seen 4.15 and it doesn't give very much information. For example, how
to apply anything it says at all. Do you happen to know of a tutorial that
does explain it and give examples?

Thanks, Lee
Jul 23 '05 #8

P: n/a
> if (document.layers){
//use the document.layers collection
}

if (document.getElementByID){
//use the getElementByID method
}

if (document.all){
//use the document.all collection
}


BTW, I tested each of these under NS7.2 and they all returned false.

Thanks, Lee
Jul 23 '05 #9

P: n/a
Lee David wrote:
if (document.layers){
//use the document.layers collection
}

if (document.getElementByID){

----------------------------^

if ( document.getElementById ){

Case sensitivity's a bitch, eh?
[...]

--
Rob
Jul 23 '05 #10

P: n/a
Lee David wrote:
For the sake of the exercise:

var supportForLayers = !!document.layers;

The use of !! forces the result to be explicitly true or false and have
the right sense.
I'm using <div> to enclose the text that I want to appear. I understand
that Layers is an older and not needed technology. However, the check for
it indicates the usage of NS which used totally different values than IE
does. Therefore, I'm assuming I could use the above and then have code like
this:

if (supportForLayers)
{
turn on the various <div> based on which object incurred the mouseover or
mouseout event using "show"
turn off the various <div> that are not applicable to the triggering event
using "hide"
}

if (supportForAll)
{
turn on the various <div> based on which object incurred the mouseover or
mouseout event using "visible"
turn off the various <div> that are not applicable to the triggering event
using "hidden"
}


That's the right strategy, only test for the most common choice first -
Communicator 4 represents perhaps 1:1000 web surfers, so do the test
that will be true for the vast majority of cases first.
function setVisibility ( el, state ) {
if ( el.style ) {
el.style.visibility = ('visible'==state)? 'visible' : 'hidden';
} else if ( el.visibility ) {
el.visibility = ('visible'==state)? 'show' : 'hide';
} else {
// Some other option?
}
}
If the above is called with:

setVisibility ( elementReference, 'visible' );

it will change the visibility property to visible or show. Anything
else and it will be changed to hidden or hide.

I don't have Communicator 4 handy so I can't test it, but it should be OK.

Would I need something for Opera, Firefox or other modzilla browsers?


No. The idea is to test for functionality, not browser.

--
Rob
Jul 23 '05 #11

P: n/a
I want to thank you t h i s much. It works now and at
last I can move on to the next (to be discovered) problem!

Lee
Jul 23 '05 #12

P: n/a
RobG said the following on 7/21/2005 11:44 PM:
Lee David wrote:
if (document.layers){
//use the document.layers collection
}

if (document.getElementByID){


----------------------------^

if ( document.getElementById ){

Case sensitivity's a bitch, eh?


Aint it though? I will have to smack myself on the hands for that one.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.