|
|
"Welcome Safari User" Tag on webpages
|
|
|
|
Forum Regular
Join Date: May 2001
Location: outside your window; your wife is look'n good
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
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...
|
|
|
|
|
|
|
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
i'd guess something along the lines of an Extended Server Side Include, like this:
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
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 Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|