Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > "Welcome Safari User" Tag on webpages

"Welcome Safari User" Tag on webpages
Thread Tools
DeepDish
Forum Regular
Join Date: May 2001
Location: outside your window; your wife is look'n good
Status: Offline
Reply With Quote
Jan 20, 2003, 11:33 PM
 
I read on MacMinute about Apple and now Macnet adding a special logo to the top of pages whenever a Safari browser accesses thier pages.

Any advice on how I can add this to my html pages too?

examples:
http://www.macnet2.com/

http://www.macminute.com/2003/01/20/safariuser
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 21, 2003, 12:04 AM
 
Originally posted by DeepDish:
I read on MacMinute about Apple and now Macnet adding a special logo to the top of pages whenever a Safari browser accesses thier pages.

Any advice on how I can add this to my html pages too?

examples:
http://www.macnet2.com/

http://www.macminute.com/2003/01/20/safariuser
Here's the code snippet from apple.com, slightly altered in case you didn't want to promote powerbooks on your own website:

Code:
[SCRIPT LANGUAGE = "JavaScript"] var SafariMessage = "Welcome Safari User!" var NoSafariMessage = "Welcome... um... Non-Safari User!" if (navigator.userAgent.indexOf('Safari') != -1) { document.write(SafariMessage); } else { document.write(NoSafariMessage); } [/SCRIPT]
Computer thez nohhh...
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Jan 21, 2003, 12:28 AM
 
i'd guess something along the lines of an Extended Server Side Include, like this:

"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jan 21, 2003, 01:13 AM
 
If it's in a jsp page, something like this (untested):

Code:
<% if ( request.getHeader("HTTP_USER_AGENT").indexOf("Safari") > -1 ) { %> Welcome, Safari Guy <% } %>
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:13 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,