| | |
help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
It would help to see the code. It's kind of hard to help debug code that you can not see 
For the record tho. If it doesn't work in Mozilla and the other standards supporting browsers, it doesn't work.
IE is flawed, so some code that shouldn't work works, but a lot of code that should work doesn't work.
It's always best to create code that works in the standards supporting browsers first (Firefox/Opera/Chrome/etc...) and then apply fixes for the others (others being IE).
If you do it the other way around you'll go insane for sure

For the record tho. If it doesn't work in Mozilla and the other standards supporting browsers, it doesn't work.
IE is flawed, so some code that shouldn't work works, but a lot of code that should work doesn't work.
It's always best to create code that works in the standards supporting browsers first (Firefox/Opera/Chrome/etc...) and then apply fixes for the others (others being IE).
If you do it the other way around you'll go insane for sure
I did a bit of searching on the w3 website and found a javascript code which detects what browser you are using. So if it is javascript you are trying to use then the below code allows 2 separate codes to be used, 1 for Internet Explorer while the other js code is for any other browser. So the script is:
And as the comments show in the code box above, you can place separate code for Internet Explorer.
Note: Next time please try and post in the appropriate section as this thread currently has no reference to php other than that the javascript is been echo""; by php.
javascript Syntax (Toggle Plain Text)
<script type="text/javascript"> var browser=navigator.appName; if (browser="Microsoft Internet Explorer") { //Internet explorer code } else { //Code for any other browser } </script>
Note: Next time please try and post in the appropriate section as this thread currently has no reference to php other than that the javascript is been echo""; by php.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
I would avoid coding to specific browsers, like you suggest.
It is far better to code to available objects, falling back on buggy code only if the standard method isn't available.
For example, to create an AJAX object. Rather than detect the browser and move on from there, like so:
You should check if the standard XMLHttpRequest object exists:
This way, if Microsoft ever catches up on standards, the buggy code will automatically be ignored.
It is far better to code to available objects, falling back on buggy code only if the standard method isn't available.
For example, to create an AJAX object. Rather than detect the browser and move on from there, like so:
javascript Syntax (Toggle Plain Text)
var ajaxObject = null; if (navigator.appName == "Microsoft Internet Explorer") { ajaxObject = new ActiveXObject("Msxml2.XMLHTTP"); } else { ajaxObject = new XMLHttpRequest(); }
javascript Syntax (Toggle Plain Text)
var ajaxObject = null; if(window.XMLHttpRequest) { ajaxObject = new XMLHttpRequest(); } else { ajaxObject = new ActiveXObject("Msxml2.XMLHTTP"); }
Last edited by Atli; Nov 6th, 2008 at 4:35 am.
![]() |
Other Threads in the PHP Forum
- Previous Thread: need rotating div display, preferably in PHP
- Next Thread: TEACH PHP
| Thread Tools | Search this Thread |
apache api array beginner beneath binary broadband broken button cakephp checkbox class cms code countingeverycharactersfromastring crack cron curl data database date decode display dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip javascript joomla limit link links login mail match md5 menu mlm multiple mysql mysql_real_escape_string oop paypal pdf php problem protocol query radio random recursion remote script search searchbox server session sessions sms smtp soap source space sql strip_tags survey syntax system table tutorial undefined update upload url validator variable video virus votedown web website window.onbeforeunload=closeme; xml youtube






