Connecting Tech Pros Worldwide Forums | Help | Site Map

"error on page"

Lee David
Guest
 
Posts: n/a
#1: Jul 23 '05
How do you track down this to where the error actually is?

TIA, Lee



frizzle
Guest
 
Posts: n/a
#2: Jul 23 '05

re: "error on page"


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

Randy Webb
Guest
 
Posts: n/a
#3: Jul 23 '05

re: "error on page"


Lee David said the following on 7/21/2005 4:46 PM:[color=blue]
> How do you track down this to where the error actually is?[/color]

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
Lee David
Guest
 
Posts: n/a
#4: Jul 23 '05

re: "error on page"


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" <phpfrizzle@gmail.com> wrote in message
news:1121981773.544782.231840@g47g2000cwa.googlegr oups.com...[color=blue]
> Depends on the browser,
> in Internet Explorer for instance, you can double click
> on the error icon: left-lower corner, and view the details ...
>[/color]


Randy Webb
Guest
 
Posts: n/a
#5: Jul 23 '05

re: "error on page"


Lee David said the following on 7/21/2005 6:36 PM:
[color=blue]
> 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:[/color]

Why does it matter if its Netscape, Mozilla, FunkyBrowser or
myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.
[color=blue]
> if (document.layers)
> {
> alert("**testing** NS");
> var ns4test = true;
> var ie4test = false;
> }
>
> Nor did the more compact:
> ns4test = document.layers?true:false;[/color]

That actually "works", it just doesn't work the way you think it would.
[color=blue]
> Again, thanks for the quick response... I'll put my shoe down and the
> monitor is safe again.[/color]

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?
RobG
Guest
 
Posts: n/a
#6: Jul 23 '05

re: "error on page"


Lee David wrote:
[...][color=blue]
>
> Nor did the more compact:
> ns4test = document.layers?true:false;
>[/color]

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
Lee David
Guest
 
Posts: n/a
#7: Jul 23 '05

re: "error on page"


> For the sake of the exercise:[color=blue]
>
> var supportForLayers = !!document.layers;
>
> The use of !! forces the result to be explicitly true or false and have
> the right sense.
>[/color]

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


Lee David
Guest
 
Posts: n/a
#8: Jul 23 '05

re: "error on page"


>[color=blue]
> Why does it matter if its Netscape, Mozilla, FunkyBrowser or
> myBrowserThatIMadeUpTheName? You don't browser detect, you feature detect.
>[/color]

Because specific browsers have specific and unique values such as Netscape's
"show" vs. the IE "visible."
[color=blue]
>
> That actually "works", it just doesn't work the way you think it would.
>[/color]

Could you elaborate on how it is working vs. how it would be expected to?
[color=blue]
>
> 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.
>[/color]

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


Lee David
Guest
 
Posts: n/a
#9: Jul 23 '05

re: "error on page"


> if (document.layers){[color=blue]
> //use the document.layers collection
> }
>
> if (document.getElementByID){
> //use the getElementByID method
> }
>
> if (document.all){
> //use the document.all collection
> }[/color]

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

Thanks, Lee


RobG
Guest
 
Posts: n/a
#10: Jul 23 '05

re: "error on page"


Lee David wrote:[color=blue][color=green]
>>if (document.layers){
>>//use the document.layers collection
>>}
>>
>>if (document.getElementByID){[/color][/color]
----------------------------^

if ( document.getElementById ){

Case sensitivity's a bitch, eh?


[...]

--
Rob
RobG
Guest
 
Posts: n/a
#11: Jul 23 '05

re: "error on page"


Lee David wrote:[color=blue][color=green]
>>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.
>>[/color]
>
>
> 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"
> }[/color]

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.
[color=blue]
>
> Would I need something for Opera, Firefox or other modzilla browsers?[/color]

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



--
Rob
Lee David
Guest
 
Posts: n/a
#12: Jul 23 '05

re: "error on page"


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


Randy Webb
Guest
 
Posts: n/a
#13: Jul 23 '05

re: "error on page"


RobG said the following on 7/21/2005 11:44 PM:[color=blue]
> Lee David wrote:
>[color=green][color=darkred]
>>> if (document.layers){
>>> //use the document.layers collection
>>> }
>>>
>>> if (document.getElementByID){[/color][/color]
>
> ----------------------------^
>
> if ( document.getElementById ){
>
> Case sensitivity's a bitch, eh?[/color]

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
Closed Thread