stop javascript from executing when the page loads?

  • Thread starter Thread starter MMJII
  • Start date Start date
M

MMJII

Hello All,
I have a web page that has a link on it to display a JavaScript popup.
</body>
<script language="JavaScript1.2" src="popupmsg.js"></script>
<script language="JavaScript1.2" src="cpw.js"></script>

Is there a way to make this JavaScript not execute when the page loads?
I want the popup to display when the link is depressed only.



Thanks for any ideas
MMJII
 
Place a function call at the very beginning of
the "main" js file,
such as:
function On()

and then in your hyperlink add:

onmousedown="On()"

The the script "shouldn't" fire until the
function is "called" by the mouse click
 
Check your <body> tag for a onload statement, then remove.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
Back
Top