View Full Version : Adding Onclick Code to DIV, help?

05-27-2012, 01:41 AM
Hi, not sure if this is a HTML problem but I hope someone can reply with a solution, I'd really appreciate it. Been googling and can't figure it out.

I'd like my widget code to show up when my div is used.

The div looks like this: (It's an image)

<div class="proceed"></div>

The widget code is below (it shows a pop up with surveys, it's a CPA widget)

<script type="text/javascript" src="http://gateway.wfnetwork.com/widget/contentBlocker.js.php?i=1025"></script>

What can I do to add the code so the surveys show the second <div class="proceed"> is used (or clicked - it's an image).

05-27-2012, 03:49 PM

One way would be this:

<div class="proceed" onclick="xcv()"></div> <!-- Image activation to survey -->
Function xcv() can be the code that helps activate the survey, by including the script using jQuery.

$.getScript("my_lovely_script.js", function(){

alert("Script loaded and executed.");
// here you can use anything you defined in the loaded script


Other than that, you can use a div ID for the image, and it can be replaced with the external script you have.