![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
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
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Join Date: Nov 2006
Posts: 31
|
if(navigator.AppName== 'Netscape') - it's netscape, seamonkey,firefox or whatever, otherwise it's 99% IE
__________________
The only legal way to earn millions |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
thats of no help to call the JS in html file
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2002
Location: European Union
Posts: 1,752
|
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
what i wanna do calvin is in the html tell it if its IE use this .js else use the other .js
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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.
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
Thanks psili
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
A freakin' legend!
Industry Role:
Join Date: Feb 2004
Location: Las Vegas, Nevada USA
Posts: 18,975
|
Is javascript really necessary?
__________________
Boner Money |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Jul 2004
Location: The Beach
Posts: 4,626
|
Quote:
that's for writing shit in php
__________________
ICQ# 143561781 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
Just meant "echo" the include line to the browser... guess it was more pseudo code I threw in there, than anything else.
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
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> <script> var browser_type=navigator.appName var browser_version=parseInt(navigator.appVersion) //if IE 4+ if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4){ document.write("- press any keyboard key to skip to the next picture -<br>"); ie(); } else { notie(); } </script> Code:
function ie() { alert('Your using internet explorer'); } function notie() { alert('Your not using internet explorer'); }
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Aug 2001
Location: Scotland
Posts: 2,238
|
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 ...
__________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Workin With The Devil
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
|
Thanks Razor and Smokey
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Aug 2001
Location: Scotland
Posts: 2,238
|
__________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. |
![]() |
![]() ![]() ![]() ![]() ![]() |