global variable to indicate NS or IE 
Author Message
 global variable to indicate NS or IE

Hi

How do I set a global page variable that indicates app type.
So that in later functions I can say
function test()
if VarApp = "IE"  do my stuff

Thanks
Tom



Sun, 20 Apr 2003 02:36:24 GMT  
 global variable to indicate NS or IE
In IE, document.all is not null. In NS, it is null.
if(document.all)
alert("found IE");
else
alert("IE not found")
--
Mark L. Ferguson    Reply Only in Newsgroup
marfer's notes for OE 5.0 > http://www.geocities.com/marfer_mvp/IE_ng_notes.htm
Quote:

> Hi

> How do I set a global page variable that indicates app type.
> So that in later functions I can say
> function test()
> if VarApp = "IE"  do my stuff

> Thanks
> Tom



Sun, 20 Apr 2003 10:22:05 GMT  
 global variable to indicate NS or IE
Thanks Mark
This works for IE, but nothing happens with NS (no alert), can you see why
please ?

<HTML>
<HEAD>
<script language=Javascript>
<!--
if(document.all)
vIE = 1
else
vIE = 0
-->
</script>
</HEAD>

<BODY>
<script language=Javascript>
<!--
window.alert(vIE)
-->
</script>
</BODY>
</HTML>

--
Tom
-------------------------------------



In IE, document.all is not null. In NS, it is null.
if(document.all)
alert("found IE");
else
alert("IE not found")
--
Mark L. Ferguson    Reply Only in Newsgroup
marfer's notes for OE 5.0 >
http://www.geocities.com/marfer_mvp/IE_ng_notes.htm

Quote:
> Hi

> How do I set a global page variable that indicates app type.
> So that in later functions I can say
> function test()
> if VarApp = "IE"  do my stuff

> Thanks
> Tom



Sun, 20 Apr 2003 12:05:09 GMT  
 global variable to indicate NS or IE
Client-side: You can use a Cookie
Server-side (asp): You can use Session Vars...

Fred


Quote:
> Hi

> How do I set a global page variable that indicates app type.
> So that in later functions I can say
> function test()
> if VarApp = "IE"  do my stuff

> Thanks
> Tom



Sun, 20 Apr 2003 19:54:25 GMT  
 global variable to indicate NS or IE



In IE, document.all is not null. In NS, it is null.
if(document.all)

That is true, however the existence of document.all is not a reliable test
that the browser is IE, it's been reported in clj that other browsers have a
document.all.  (I can't recall which, check deja.com if you need to find
out.)

Jim.



Sun, 20 Apr 2003 19:59:44 GMT  
 global variable to indicate NS or IE

You have to hide the SGML end-of-comment marker from NS or the code will not
execute at all. Make the end-of-comment a JavaScript comment:

  // JS Comment to hide SGML from NS -->

=-=-=
Steve
-=-=-


Quote:
> Thanks Mark
> This works for IE, but nothing happens with NS (no alert), can you see why
> please ?

> <HTML>
> <HEAD>
> <script language=Javascript>
> <!--
> if(document.all)
> vIE = 1
> else
> vIE = 0
> -->
> </script>
> </HEAD>

> <BODY>
> <script language=Javascript>
> <!--
> window.alert(vIE)
> -->
> </script>
> </BODY>
> </HTML>

> --
> Tom
> -------------------------------------



> In IE, document.all is not null. In NS, it is null.
> if(document.all)
> alert("found IE");
> else
> alert("IE not found")
> --
> Mark L. Ferguson    Reply Only in Newsgroup
> marfer's notes for OE 5.0 >
> http://www.geocities.com/marfer_mvp/IE_ng_notes.htm


> > Hi

> > How do I set a global page variable that indicates app type.
> > So that in later functions I can say
> > function test()
> > if VarApp = "IE"  do my stuff

> > Thanks
> > Tom



Sun, 20 Apr 2003 22:31:38 GMT  
 global variable to indicate NS or IE
Thanks Steve
That was my problem.

--
Tom
-------------------------------------
http://engines2go.com - Fast access to all the major search engines.
No Ads, Pictures or Banners.


Quote:
> You have to hide the SGML end-of-comment marker from NS or the code will
not
> execute at all. Make the end-of-comment a JavaScript comment:

>   // JS Comment to hide SGML from NS -->

> =-=-=
> Steve
> -=-=-



> > Thanks Mark
> > This works for IE, but nothing happens with NS (no alert), can you see
why
> > please ?

> > <HTML>
> > <HEAD>
> > <script language=Javascript>
> > <!--
> > if(document.all)
> > vIE = 1
> > else
> > vIE = 0
> > -->
> > </script>
> > </HEAD>

> > <BODY>
> > <script language=Javascript>
> > <!--
> > window.alert(vIE)
> > -->
> > </script>
> > </BODY>
> > </HTML>

> > --
> > Tom
> > -------------------------------------



> > In IE, document.all is not null. In NS, it is null.
> > if(document.all)
> > alert("found IE");
> > else
> > alert("IE not found")
> > --
> > Mark L. Ferguson    Reply Only in Newsgroup
> > marfer's notes for OE 5.0 >
> > http://www.geocities.com/marfer_mvp/IE_ng_notes.htm


> > > Hi

> > > How do I set a global page variable that indicates app type.
> > > So that in later functions I can say
> > > function test()
> > > if VarApp = "IE"  do my stuff

> > > Thanks
> > > Tom



Mon, 21 Apr 2003 02:21:16 GMT  
 global variable to indicate NS or IE

Walter
That could be useful  :-)

Thanks
--
Tom
-------------------------------------
http://engines2go.com - Fast access to all the major search engines.
No Ads, Pictures or Banners.



Quote:

> navigator.appName returns "Micosoft Internet Explorer" for IE,
> "Netscape" for Netscape, and either some other string or an error for
> other browsers.



> : Thanks Mark
> : This works for IE, but nothing happens with NS (no alert), can you
> see why
> : please ?
> :
> : <HTML>
> : <HEAD>
> : <script language=Javascript>
> : <!--
> : if(document.all)
> : vIE = 1
> : else
> : vIE = 0
> : -->
> : </script>
> : </HEAD>
> :
> : <BODY>
> : <script language=Javascript>
> : <!--
> : window.alert(vIE)
> : -->
> : </script>
> : </BODY>
> : </HTML>
> :
> :
> : --
> : Tom
> : -------------------------------------
> :
> :
> :


> : In IE, document.all is not null. In NS, it is null.
> : if(document.all)
> : alert("found IE");
> : else
> : alert("IE not found")
> : --
> : Mark L. Ferguson    Reply Only in Newsgroup
> : marfer's notes for OE 5.0 >
> : http://www.geocities.com/marfer_mvp/IE_ng_notes.htm


> : > Hi
> : >
> : > How do I set a global page variable that indicates app type.
> : > So that in later functions I can say
> : > function test()
> : > if VarApp = "IE"  do my stuff
> : >
> : > Thanks
> : > Tom
> : >
> : >
> : >
> : >
> :
> :
> :



Mon, 21 Apr 2003 02:22:56 GMT  
 global variable to indicate NS or IE
Thanks Fred

I forgot to say I only needed a temporary variable.  Although I can see that
a cookie would do that too - it seems a bit much for what I need, but worth
considering anyway.

--
Tom
-------------------------------------
http://engines2go.com - Fast access to all the major search engines.
No Ads, Pictures or Banners.


Quote:
> Client-side: You can use a Cookie
> Server-side (asp): You can use Session Vars...

> Fred



> > Hi

> > How do I set a global page variable that indicates app type.
> > So that in later functions I can say
> > function test()
> > if VarApp = "IE"  do my stuff

> > Thanks
> > Tom



Mon, 21 Apr 2003 02:25:58 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Compatitibilty problem NS/IE

2. Newsgroup dedicated to NS vs IE javascript?

3. Javascript Scroller for IE & NS

4. Various problems, NS versus IE + and -

5. Works in NS, but not IE (Japanese Characters)

6. close windows IE vs. NS

7. open windows in NS and IE?

8. which is better? IE or NS

9. onClick to open selection in new Window - NS 4 works, IE 4 Fails

10. onClick to open selection in new Window - NS 4 works, IE 4 Fa ils

11. <SPAN> with NS and IE

12. JScript Problem - IE/NS Incompatibility

 

 
Powered by phpBB® Forum Software