| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
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. |
|
|
|
|
|
#2 (permalink) |
|
Goodbye little old lady
|
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 |
|
|
|
#3 (permalink) |
|
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. |
|
|
|
#4 (permalink) |
|
Zły
|
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... |
|
|
|
#5 (permalink) |
|
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. |
|
|
|
#9 (permalink) |
|
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. |
|
|
|
#10 (permalink) |
|
hmmm...
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:
picked out from: http://www.webreference.com/tools/browser/sniffer2.js |
|
![]() |