PDA

View Full Version : external js under ASP


jamguitar
04-03-2003, 12:15 PM
I tried to external js file loading under ASP environment, however, I only sucess showing up the Alert Message.

Once, I remove the // out of hello.js the Alert Message wouldnt appear.

Moreover, how do i make the calling funciton working under hi.htm

My file as
+========================================+
hi.htm
+========================================+
<html>
<head>
<title>Hello World</title>
<script language="JavaScript" type="text/javascript"
src="hello.js">

</script>
</head>

<body >
Blah blah blah

</body>
</html>
+========================================+



+========================================+
hello.js
+========================================+
alert('hee')

//functon helloWorld()
//{
alert( 'Hello World!' )
//}

alert('HEY')

+========================================+

miranda
04-03-2003, 06:29 PM
Are you trying to get the alerts to open at a specific time? or on a specific action done by the user?


And where is the asp involved here?? this is simple html and client side javascript

Roy Sinclair
04-03-2003, 07:01 PM
Of course the message doesn't appear if you remove the \\ in front of the lines in your JS file. The way the file is right now the alert is executed as the page is loaded, removing the comment marks moves the alert inside a function but nowhere else do you call that function so of course it's not executed.