Re: [NTLK] Newtscape, ETC.

From: Ed Kummel (tech_ed_at_yahoo.com)
Date: Mon Jan 06 2003 - 13:33:11 EST


Unfortunatly, Javascript doesn't work with Newton
browsers so this javascript code will be ignored by
all Newton Browsers which means that the web page will
be returned irregardless of the whether or not there
is a Newton at the other end. The only way to get this
to work is to use a server side scripting method and
use the http environment variables. In this case, you
would need to query the http_user_agent system
environment variable from the browser. Parse this by
browser type and you may be able to get the page to be
customized for the Newt...I've never tried it, so
YMMV!
Here is what I did in Cold Fusion and it seems to work
with desktop browsers, but I can't get it to work with
NetHopper. My conclusion is that Nethoper doesnt
support http header information:
<body>
This is your browser type:
<cfoutput>#cgi.HTTP_USER_AGENT#</cfoutput>
<p>
<cfif findNoCase("MSIE",HTTP_USER_AGENT,1)>
<cfoutput>You are using explorer</cfoutput>
<cfelseif findNoCase("NAV",HTTP_USER_AGENT,1)>
<cfoutput>you are using Nutscrape</cfoutput>
<cfelseif findNoCase ("Opera", http_user_agent,1)>
<cfoutput>you are using Opera</cfoutput>
<cfelseif findNoCase ("Newton", http_user_agent,1)>
<cfoutput>You are using a Newton</cfoutput>
<cfelse>
I don't know what browser you are using
</cfif>

Ed
web/gadget guru
http://newton.tek-ed.com (download Newton packages)
http://npds.tek-ed.com (my NPDS server and it's new
subdomain)
--- Glen Warner <gdwarner_at_mindspring.com> wrote:
>
> NewtonGuy <newton2100_at_alltel.net> wrote:
>
> > Is there a way to do a browser check for Newton
> browsers? I would
> like
> > to be able to forward these browsers to simple
> pages if they go to
> one
> > of my sites. I code pages mainly for newer
> browsers and since I have
> > read here of problems for newtons browsing sites
> with tables etc, I
> > want to accommodate.
>
> A little JavaScript in the head of your pages should
> do the trick ...
> include something like --
>
> var isNS = 0;
> var isMSIE = 0;
> var isOpera = 0;
> var isOtherBrowser = 0;
>
> if (navigator.appName.indexOf('Netscape')
> isNS=1;
>
> Else {
>
> if (navigator.appName.indexOf('MSIE')
> isMSIE = 1;}
>
> Else {
>
> if (navigator.appName.indexOf('Opera')
> isOpera = 1;}
>
> Else {isOtherBrowser)}
>
> You know, something like that. From here, you
> should be able to
> direct the visitor to your site to an appropriately
> coded page.
>
> I should warn you -- my DHTML class starts Monday,
> so that code will
> more than likely need a lot of modification to work.
>
> Good luck!
>
> --gdw

=====
May every SPAM you receive magically come true.
 -Spencer F. Katt; eWeek magazine

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/



This archive was generated by hypermail 2.1.2 : Sun Jan 26 2003 - 04:02:17 EST