event handler

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

event handler

Post by nincha »

how would you make an onClick to open a javascript???
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

open a javascript? what do you mean?
c_capo
Forum Newbie
Posts: 1
Joined: Fri May 30, 2003 2:52 am
Location: Belgium

Post by c_capo »

<script>
function showAlert(){
alert('yeah yeah');
}
</script>


<a href="#" onclick="showAlert();">show alert</a>
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

Post by nincha »

woops, i meant an external src. ex:hello.js
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

What exactly do you mean?

It looks to me as if you were looking for a code to include external javascript-files - if so the code is

Code: Select all

<SCRIPT LANGUAGE=JavaScript SRC="myjavascriptfile"></SCRIPT>
If not, please explain in greater detail.
Post Reply