Jump to content

how to hyperlink an Image to Javascript?


natasha_thomas

Recommended Posts

Friends,

 

In my wordpress blog, i want to hyperlink the below Javascript to an Image....

 

<!-- TWO STEPS TO INSTALL POPUP WINDOW:

   1.  Paste the first into the HEAD of your HTML document
   2.  Use the code to open the popup page on your site  -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by:  Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=700,height=400,left = 162,top = 184');");
}
// End -->
</script>


<!-- STEP TWO: Use the following button code for the new window -->

<form>
<input type=button value="Open the Popup Window" onClick="javascript:popUp('<?php bloginfo('url');?>/my-account/shoppers-live-help-chat-system')">
</form>

<!-- Script Size:  0.73 KB  -->

 

The image URL is: www.abc.com/myimage.jpg

 

How can this be achieved?

Link to comment
Share on other sites

The wording of your request is a little confusing. I don't know what it means to hyperlink Javascript to an image. I fyou are saying you want a Javascript function to run when the user clicks an image, then just add an onclick event to the image.

 

Based upon the button example in the code above I guess it would look something like this:

onClick="popUp('<?php bloginfo('url');?>/my-account/shoppers-live-help-chat-system');"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.