Reply LinkBack Thread Tools Search this Thread
Old 02-02-2006, 16:32   #1 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Filtering Out JavaScript for IE/Mac

Oh, boy. So I've recoded the templates for a corporate intranet. All fine and dandy. Personnel directories are all nicely coded into tables with JavaScript to make fancy-schmancy zebra tables with rollovers for the rows. Additionally, there's a script (from Particletree) to append icons to the end of anchors that lead to PDFs, DOCs, XLSs, etc.

Here's the problem: At the moment, Mac users at the corporate office cannot log into the intranet through Safari and have to use IE/Mac. Don't ask me why, but it's there.

Problem is this: Not only do the tables look pretty bad, but the JavaScript is all messed up. Excel icons are being appended to the end of table rows (wtf?) and the table rollovers don't go away. This makes directory tables virtually unusable for IE/Mac users.

Anyone who can suggest a method of blocking the JavaScripts from IE/Mac gets to be my best friend today.
  Reply With Quote
Old 02-02-2006, 16:46   #2 (permalink)
chris_bcn
Goodbye little old lady
 
chris_bcn's Avatar
 
Join Date: Jun 2005
Location: Geordie in SF
Posts: 339
Send a message via MSN to chris_bcn
to be honest PGO - as someone who predominately does intranet stuff - I'd lose the fancy schmancy stuff. There's nothing gained by having rollovers on table cells/rows.

What I do is use the :hover pseudo class so the various people that us FF can enjoy it - IE /IE mac (vast majority) don't, but get a functional table. Then it's on to the next project!

Corporate intranets are a different beast to public websites in some ways. KISS is most definately the way
  Reply With Quote
Old 02-02-2006, 16:49   #3 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Well, I was thinking that may be the solution. The reason I had done that was that these are tables with potentially hundreds of rows...or a series of tables with 10-50 rows. It's...a lot to look at. Anyway, I'll keep digging.
  Reply With Quote
Old 02-02-2006, 17:05   #4 (permalink)
adras
Zły
 
adras's Avatar
 
Join Date: May 2004
Location: Toronto, Canada
Posts: 1,999
Send a message via MSN to adras
Are these HTML files that you are working with or PHP, ASP etc? If the latter then you can detect the browser type and not include the javascript code.

Or you can do javascript browser detection before the main javascript code, and have a if statment - if not mac/ie include the javascript functions else hide them and don't run the javascript...
__________________
  Reply With Quote
Old 02-02-2006, 17:14   #5 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
I guess I could do some browser sniffing. The only browsers I thought I was worried about were IE6 and FF. If I can get reliable results looking for IE/Mac specifically, then I may use that. If not, then I'll just serve up plain, bland tables. :P

Yes, they're flat HTML files. Dreamweaver templates as content management. It's not ideal, but it works for these purposes.
  Reply With Quote
Old 02-02-2006, 17:45   #6 (permalink)
chris_bcn
Goodbye little old lady
 
chris_bcn's Avatar
 
Join Date: Jun 2005
Location: Geordie in SF
Posts: 339
Send a message via MSN to chris_bcn
If your place is anything like where I am at the moment, most people will print out the pages rather than look at them on a screen.

Drives me mad
  Reply With Quote
Old 02-02-2006, 18:04   #7 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Don't know, but you've reminded me I've got to get writing a print stylesheet for it.
  Reply With Quote
Old 02-02-2006, 18:06   #8 (permalink)
chris_bcn
Goodbye little old lady
 
chris_bcn's Avatar
 
Join Date: Jun 2005
Location: Geordie in SF
Posts: 339
Send a message via MSN to chris_bcn
oh aye - vital - especially on intranet sites
  Reply With Quote
Old 02-02-2006, 23:45   #9 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Good to know. Thanks for the tip.

Now my boss tells me that it's not really a concern. The current intranet is being rebuilt for parent company, so we have it on an IIS staging server. IT guys have it set up in such a way that Safari doesn't let you log in. Don't know why, don't care - not my area.

However, once it's launched it'll be moved, so the Safari incompatibility won't be an issue.
  Reply With Quote
Old 03-02-2006, 08:37   #10 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
What about using FFox for mac? (or opera?)

Should be easy enough to do though, as you just need to identift platform and browser, not version numbers or owt.

Just whack all the code in a function (let's call it go for the sake of argument). Then onload check for platform and browser. If it's not mac and ie away you go.

Code:
window.onload = function() { var is_mac = (agt.indexOf("mac")!=-1); var is_ie = (appVer.indexOf('msie')!=-1); if (!is_mac && !is_ie) go(); } function go() { // your script goes here }

picked out from:
http://www.webreference.com/tools/browser/sniffer2.js
  Reply With Quote
Old 03-02-2006, 16:22   #11 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Thanks, stick. I'll do that on Monday. No sense in bothering today. It's Friday, afterall.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8