/    Sign up×
Community /Pin to ProfileBookmark

Hi all I am a webdesign student that are completly new to JavaScript.
and in my course i got an asigment that i should do a web browser control that should pop up in a alert box, but i can’t get the code to work, Can any one help me with this?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@JavaScriptNickJan 19.2011 — Post your code.
Copy linkTweet thisAlerts:
@DavidthedruidauthorJan 19.2011 — this is my code ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>inupp1</title>

<script language="javascript"><!--

var isNN;

if (navigator.appName == "Netsacpe")

{

isNN=true;

alert("du använder netscape")

}

else

{ isNN=false;

alert("du använder IE")

}


// --></script>

</head>

<body>

<h1 valign="center">v&auml;lkommen till inupp1</h1>

<p> Vi h&auml;r på inupp1 h&auml;lsar dig v&auml;kommen</p>

</body>

</html>
Copy linkTweet thisAlerts:
@WolfShadeJan 19.2011 — What is it not doing (how is it breaking)?

What (if any) JavaScript error messages are there?

^_^
Copy linkTweet thisAlerts:
@DavidthedruidauthorJan 19.2011 — it is ment to be showing in the alert box that you use Netscape if you use it and if you use Internet explorer it should say that, But regardless if i use a netscape or IE webbrowser it says that it is an IE webbrowser i use.
Copy linkTweet thisAlerts:
@SockwaveJan 19.2011 — if (navigator.appName == "Netsacpe")

It looks like you misspelled "Netscape" there, which would cause it to alert that you are using IE no matter what. Let me know if that fixes it.
×

Success!

Help @Davidthedruid spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...