Jump to content

Help with Javascript, Browser Detection and how to use it?


Recommended Posts

Hey guys,Long time reader (and learner), first time poster here.I'm definiately a noob when it comes to web page development, but I'm currently putting something nifty together for a school project, and I need some help, specifically re: browser detection and how to use this. What I'm wanting to do is this:- User visits webpage- Script detects browser- If browser is firefox, deploy/use code A- Else if browser is safari, deploy/use code B- Else if browser is IE, deploy/use code C- Browser loads browser-specific codeI would really really appreciate any help I can get here from anyone! Thank you in advance Ben

Link to comment
Share on other sites

There is almost always a better solution than browser detection. Please explain the problem you are trying to solve.
Well, a small part of my code causes my page to only run correctly on Safari and Chrome, however if I alter this ever so slightly the page will display correctly on Firefox.

will display my page properly on Firefox, whereas


will display my page correctly on Safari and Chrome. So, I want to be able to run each piece of code based on the browser used to visit the site.Thanks heaps Ben

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...