Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Onclick Code to DIV, help?

    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)

    Code:
    <div class="proceed"></div>
    The widget code is below (it shows a pop up with surveys, it's a CPA widget)

    Code:
    <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).
    Last edited by mendez103; 05-27-2012 at 01:44 AM.

  • #2
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hello,

    One way would be this:

    Code:
    <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.

    Code:
    $.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.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •