SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Code That Counts How many Links are Clicked

    I Want an HTML Code That Counts How many Links are Clicked in all the HTML Code Of the Page

    especially the links of Google adsense that Likes That :

    <script type="text/javascript"><!--
    google_ad_client = "pub-6155056320102818";
    google_ad_width = 300;
    google_ad_height = 250;
    google_ad_format = "300x250_as";
    google_ad_type = "text_image";
    //2007-02-02: HCT Forum Square
    google_ad_channel = "9098998563";
    google_color_border = "FFFFFF";
    google_color_bg = "FFFFFF";
    google_color_link = "003399";
    google_color_text = "000000";
    google_color_url = "000000";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    HELP

    thanks!

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,598
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    The Google AdSense code inserts an iframe into your page and displays the ads in that. Since the content of the iframe comes from Google and not your site there is no access to the iframe content from JavaScript running in your page.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The Google AdSense code inserts an iframe into your page and displays the ads in that. Since the content of the iframe comes from Google and not your site there is no access to the iframe content from JavaScript running in your page.
    thank you very much with this information
    but was just wanting to count the clicks to a specific number of clicks and then
    make a link appears
    is that possible or not??
    and thank you again for your reply

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,598
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by minasto View Post
    thank you very much with this information
    but was just wanting to count the clicks to a specific number of clicks and then
    make a link appears
    is that possible or not??
    and thank you again for your reply
    Yo could count the number of clicks within your page by incrementing a count inside a cookie from an onclick event handler (or listener) attached tot he whole page. It wouldn't be able to count any clicks inside of iframes though.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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