OS/Browser Detect Question
Hello,
I'm new to scripting, but need to make sure viewers see the site correctly. The one thing I don't understand about the free OS/browser script listed here is what the <head></head> line is. For example, I can place the script where I need it, but what does this part need? here is a sample use of the browser detector, it would load a browser specific stylesheet for certain unsupported or improperly supported mac ie 5 css styles. The depth variable is used so that the javascript library file can be used from anywhere in the website, you simply insert the depth of the file like this, ... <head> <title>Browser information Page</title> <meta http-equiv = "Content-Type" content = "text/html; charset = iso-8859-1" /> <link rel = "stylesheet" type = "text/css" href = "css/main.css" /> <script type = "text/javascript" src = "/js/browser_detection.js"> </script> <script type = "text/javascript>browser_css( ); </script> </head> in the head of the web page after the js file is loaded. Or if you are always referring your site to the root, you wouldn't need that and could delete the depth variable and just use the absolute path to the root. Back to top |
|||||
I'm not clear on what the question is. Is your method working?
Stylesheets are supposed to be loaded within the <head> tags of the HTML document, that's all the <head> reference means. Did your method work for you? Have you tested it crossbrowser? Personally, I'd rather use PHP browser detection for this, users can turn off their javascript. Back to top |
|||||
I guess I didn't word that correctly.
Is all I have to do with this is throw it in the <head> tag</head>, and it'll work? Or is there some configuration I have to do? Back to top |
|||||
It all depends on your code, try it and see.
If there's no bugs in your code, it will work. Back to top |
|||||
All times are GMT - 8 Hours
|