471,046 Members | 933 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,046 software developers and data experts.

How can I make "clicking an image" launch a script?

1
I cannot find the answer anywhere on the entire net:

I have an image on my website. The image shows a newsletter, and the image says "Click here to register to receive our newsletter".

I know how to make the image link to a url, but I don't want to do that. What I want to do is when you click on the image, it calls an external javascript function that brings up a popup where you enter your name and email address and submit. The external function is handled by aweber, which is an email list manager company, and it's already created.

The external java looks like this:

<script type="text/javascript" src="http://forms.aweber.com/form/33/423434534.js"></script>

I can put this directly onto my main page in using html, but then it puts the popup directly on the page when the page loads. I don't want that to happen.

Instead, all I want for Christmas is for this javascript to load and execute when you click on the image on my website that says "Click here to register to receive our newsletter", which would then create a popup on my page where the user enters the name and email address.

Seems very simple to me, but I cannot find the answer anyway.
Thanks!
Oct 26 '09 #1
1 2822
Dormilich
8,656 Expert Mod 8TB
@jntmac
this article, example at the bottom.

@jntmac
you need to unregister the page load event handler.
Oct 26 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by al | last post: by
1 post views Thread by BKDotCom | last post: by
1 post views Thread by zelnugget | last post: by
1 post views Thread by mmcc128 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.