| | |
Detecting Mozilla using JavaScript
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Aug 2009
Posts: 12
Reputation:
Solved Threads: 0
Hi to all,
hope you all will be fine, I use a script to detect IE and Mozilla but the problem is when i run it in the firefox it won't work then i find out the name of navigator and it shows Netscape. How i detect Mozilla here is my scrip, it works fine but how i detect mozilla thanks. If i check that _app=='Mozilla' it shows unsupported browser. Thank you. One thing more is it required to enclose my script in <!-- -->.
hope you all will be fine, I use a script to detect IE and Mozilla but the problem is when i run it in the firefox it won't work then i find out the name of navigator and it shows Netscape. How i detect Mozilla here is my scrip, it works fine but how i detect mozilla thanks. If i check that _app=='Mozilla' it shows unsupported browser. Thank you. One thing more is it required to enclose my script in <!-- -->.
JavaScript Syntax (Toggle Plain Text)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title></title> </head> <body> <script language="Javascript" type="text/javascript"> document.writeln(navigator.appName); if(!navigator.javaEnabled()){ alert('Enable your java to expeirience this java enhanced page or\n try install it...'); location.replace('http://java.sun.com'); window.open('instructionsforintallingjava.html'); } else{ var _app = navigator.appName; if (_app == 'Netscape') { document.write('<embed code="CapturePlayback1.class"', 'width="200"', 'height="200"', 'archive="CapturePlayback1.jar"', 'mayscript="true"', 'pluginspage="http://java.sun.com/products/plugin/index.html#download"', 'type="application/x-java-applet;version=1.6">'); } else if (_app == 'Microsoft Internet Explorer') { document.write('<OBJECT ', 'classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"', 'codebase="http://java.sun.com/update/1.6.0/jinstall-6u13-windows-i586.cab#Version=1,5,0,0"', 'width="200"', 'height="200">', '<PARAM name="code" value="CapturePlayback1.class">', '<PARAM name="archive" value="CapturePlayback1.jar">', '<PARAM name="name" value="BrightAmericans">', '<PARAM name="mayscript" value="true">', '</OBJECT>'); } else { document.write('<p>Sorry, unsupported browser.</p>'); } } </script> <noscript> Enabled javascript please </noscript> </body> </html>
I could be wrong but i dont think there is one, as far as I know, when u use , the result in Mozilla will be Netscape.
So if the code checks for Netscape it would work in Firefox
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
navigator.appName
So if the code checks for Netscape it would work in Firefox
Life... Is a Moment
![]() |
Similar Threads
- Problem with javascript loading in Mozilla (JavaScript / DHTML / AJAX)
- IE vs FF (HTML and CSS)
- Problem with javascript code in Mozilla firefox. (JavaScript / DHTML / AJAX)
- Hmm... Javascript error, or Mozilla stupidity? (JavaScript / DHTML / AJAX)
- How to correct this javascript UNDER Mozilla Firefox? (JavaScript / DHTML / AJAX)
- ASP.NET and Mozilla - Issues! (ASP.NET)
- JavaScript's window.opener (JavaScript / DHTML / AJAX)
- Question for ASP.NET/Mozilla Users...or anyone... (ASP.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: change link border with js
- Next Thread: calculating dynamic field names
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets array blackjack browser captcha captchaformproblem cart checkbox child class close codes date debugger dependent developer disablefirebug dom editor element embed engine events explorer ext file firefox flash form forms game getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl maps marquee masterpage math matrixcaptcha media mysql object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php position post programming prototype rated redirect runtime safari scale scriptlets scroll search security session shopping size software sources star stars stretch synchronous toggle tweet unicode variables web webservice window wysiwyg \n





,
thanks yup i think you are right, because after changing to netscape it works on Mozilla firefox

