javascript help

idk what im doing wrong?!?!?

Page 1 of 1

1 Replies - 439 Views - Last Post: 28 February 2010 - 06:08 PM

#1 OMNICIDE666  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 22
  • Joined: 09-November 09

javascript help

Posted 22 February 2010 - 02:55 PM

hi im trying to use the window.onunload method but it's not working... any help is greatly appreciated :) thanks

<script>
window.onload=function start(){ 
alert("this app was made by...");
alert("Stephen G");
return true;
}
window.onunload=function end(){
alert("We are no strangers to love");
alert("you know the rules and so do I");
alert("a full commitments what what im thinking of");
alert("you wouldnt get this from any other guy");
alert("i just wanna tell how im feeling");
alert("gotta make you understand");
alert("never gonna give you up");
alert("never gonna let you down");
alert("never gonna run around and desert you");
alert("never gonna make you cry");
alert("never gonna say goodbye");
alert("never gonna tell a lie and hurt you");
alert("we have known each other for so long");
alert("Your hearts been aching but you are too shy to say it");
alert("Inside we both know whats been going on");
alert("We know the game and we are gonna play it");
alert("And if you ask me how Im feeling");
alert("Dont tell me you are too blind to see");
alert("never gonna give you up");
alert("never gonna let you down");
alert("never gonna run around and desert you");
alert("never gonna make you cry");
alert("never gonna say goodbye");
alert("never gonna tell a lie and hurt you");
alert("Ooh give you up");
alert("Ooh give you up");
alert("Ooh never gonna give, never gonna give");
alert("give you up");
alert("Ooh never gonna give, never gonna give");
alert("give you up");
alert("We have known each other for so long");
alert("Your hearts been aching but you are too shy to say it");
alert("Inside we both know whats been going on");
alert("We know the game and we are gonna play it");
alert("I just wanna tell you how Im feeling");
alert("Gotta make you understand");
alert("never gonna give you up");
alert("never gonna let you down");
alert("never gonna run around and desert you");
alert("never gonna make you cry");
alert("never gonna say goodbye");
alert("never gonna tell a lie and hurt you");
}

</script>


This post has been edited by OMNICIDE666: 22 February 2010 - 02:56 PM


Is This A Good Question/Topic? 0
  • +

Replies To: javascript help

#2 psyking  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 20
  • View blog
  • Posts: 165
  • Joined: 17-January 10

Re: javascript help

Posted 28 February 2010 - 06:08 PM

I got the code to work for me. I put the Javascript into the head of the document and it worked.

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Untitled Document</title>
		<script>
			window.onload=function start(){ 
			alert("this app was made by...");
			alert("Stephen G");
			return true;
			}
			window.onunload=function end(){
			alert("We are no strangers to love");
			alert("you know the rules and so do I");
			alert("a full commitments what what im thinking of");
			alert("you wouldnt get this from any other guy");
			alert("i just wanna tell how im feeling");
			alert("gotta make you understand");
			alert("never gonna give you up");
			alert("never gonna let you down");
			alert("never gonna run around and desert you");
			alert("never gonna make you cry");
			alert("never gonna say goodbye");
			alert("never gonna tell a lie and hurt you");
			alert("we have known each other for so long");
			alert("Your hearts been aching but you are too shy to say it");
			alert("Inside we both know whats been going on");
			alert("We know the game and we are gonna play it");
			alert("And if you ask me how Im feeling");
			alert("Dont tell me you are too blind to see");
			alert("never gonna give you up");
			alert("never gonna let you down");
			alert("never gonna run around and desert you");
			alert("never gonna make you cry");
			alert("never gonna say goodbye");
			alert("never gonna tell a lie and hurt you");
			alert("Ooh give you up");
			alert("Ooh give you up");
			alert("Ooh never gonna give, never gonna give");
			alert("give you up");
			alert("Ooh never gonna give, never gonna give");
			alert("give you up");
			alert("We have known each other for so long");
			alert("Your hearts been aching but you are too shy to say it");
			alert("Inside we both know whats been going on");
			alert("We know the game and we are gonna play it");
			alert("I just wanna tell you how Im feeling");
			alert("Gotta make you understand");
			alert("never gonna give you up");
			alert("never gonna let you down");
			alert("never gonna run around and desert you");
			alert("never gonna make you cry");
			alert("never gonna say goodbye");
			alert("never gonna tell a lie and hurt you");
			}
		</script>
	</head>
	<body>
	</body>
</html>


I'm not sure what problems you were having, but I got your code to work for me.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1