Forum : coditional statement
Brief description  about Online courses   join in Online courses
View nishant  gaurav 's Profile

coditional statement

<html>
<body>
<SCRIPT language = "JavaScript">
browsername=navigator.appName
document.write(browsername)
if (browsername == Microsoft Internet Explorer) {
document.write("this is internet explorer");
}
if (browsername == Netscape) {
document.write("this is internet explorer");
}
</SCRIPT>
</body>
</html>
its not working ,what's wrong with it?
Asked by nishant gaurav | Aug 31, 2010 |  Reply now
Replies (3)
View anonymous anonymouse 's Profile
appCodeName that is BrowserCodeName is not always Netscape.
For me the default browser is Firefox...when it get saved with particular browser(default browser)...//so i get the Name as Firefox...wen i make it as(default browser as IE) IE as Answer..
Sep 2, 2010
View nishant gaurav 's Profile
appCodeName mill result same for all the browser as the output:Netscape;
while the value for appName will be different for internet explorer and mozilla firefox.
by the way, thanks for the suggestion
nishant
Aug 31, 2010
View anonymous anonymouse 's Profile
<html>
<body>
<SCRIPT language = "JavaScript">
browsername=navigator.appName
document.write(browsername)
if (browsername == "Microsoft Internet Explorer") {
document.write("this is internet explorer");
}
if (browsername == "Netscape") {
document.write("this is internet explorer");
}
</SCRIPT>
</body>
</html>

this should work ! Can you tell me the difference between appCodeName and appName :)
Aug 31, 2010