![]() |
who knows javascript?
Im trying to figure out a way to tell it that if its using IE to use one script but if its useing any other browser to use a different script, I tried usuing regular if else statements but doesnt seem like java likes those
|
if(navigator.AppName== 'Netscape') - it's netscape, seamonkey,firefox or whatever, otherwise it's 99% IE
|
thats of no help to call the JS in html file
|
What you are describing sounds like bad programing. You should test if a given function is supported by the browser instead of testing what browser is used.
|
what i wanna do calvin is in the html tell it if its IE use this .js else use the other .js
|
Use a server side script to write the .js include:
if($_SERVER["HTTP_USER_AGENT"] == "so and so") echo "this.js"; else echo "that.js"; Or, have your .js file alias to a server side script that does the same thing internally. Otherwise, I tend to agree with Calvilnguy, that's it'd be better to just write cross-platform JS scripts. |
Thanks psili
|
Is javascript really necessary?
|
Quote:
that's for writing shit in php |
Quote:
|
why not just put the 2 javascript together in one file in sep functions..
this would go in body tag or head tag Code:
<script src=detect.js></script> Code:
|
hi Pete,
Try this: http://www.cdnetworx.com/detect.zip basically, you put the code that is in example.html into the page you want the detection on. Put your firefox javascript into fire.js and your ie specific js into ie.js should work ... if you have questions, my icq is 125-48-32-18 cheers ... |
Thanks Razor and Smokey
|
Quote:
... |
All times are GMT -7. The time now is 11:49 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123