Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6571301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:51:53+00:00 2026-05-25T14:51:53+00:00

I need some help to get this to work. It works, but i have

  • 0

I need some help to get this to work. It works, but i have to click at the side of the like button. I want it to register the click when the iframe is clicked. I tried setting the onclick in the iframe too, but that didn’t work either.

This is my script in the top of the page:

<script type="text/javascript">
function updateLikes(id) {
var ajax;

// Code for IE7+, Firefox, Chrome, Opera, Safari
if (window.XMLHttpRequest) {
    ajax=new XMLHttpRequest();
} else { // code for IE6, IE5
    ajax=new ActiveXObject("Microsoft.XMLHTTP");
}

ajax.onreadystatechange=function()
{
if (ajax.readyState==4 && ajax.status==200)
{
document.getElementById("images0").innerHTML=ajax.responseText;
}
}

ajax.open("POST","update_likes.php", false);
ajax.send("image_id=" + id);

}
</script>

Then there is what im echo’ing out:

        echo '
        <div align="center" class="images" id="images'.$i.'">
        <a class="image" border="0" href="p.php?id='.$row['id'].'">
        <img class="img" src="'.$row['path'].'" alt="image" />
        </a>
        <div class="meta" style="padding-bottom:5px;">Lastet opp av <div style="color:#47a09f; display:inline;"><a href="user.php?user='.$row['uploader'].'" style="color:#47a09f;">'.$row['uploader'].'</a></div></div>
        <div id="likebutton" class="faceLike" align="center" onClick="updateLikes(' . "'" . $row['id'] . "'" . ');"><iframe src="//www.facebook.com/plugins/like.php?app_id=144501772249167&amp;href=http://www.puffys.net/p.php?id='.$row['id'].'&amp;send=true&amp;layout=button_count&amp;width=0&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=tahoma&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:21px;" allowTransparency="true"></iframe></div>

        </div>
        ';

My problem is the facebook button. When i click it, i want it to register the click with onclick so it’s inserted to my database. But that does not happen. Only if i click at the side of the like button.

Thx in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:51:54+00:00Added an answer on May 25, 2026 at 2:51 pm

    You won’t be able to capture the click event of the DIV, as the document ONCLICK event from the IFRAME precedes it.

    Also, you won’t be able to capture the click event of the IFRAME, as it is overriden by the destination page.

    You need to use the Facebook API, as described here: Facebook "Like" button callback

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help, I have created this function and it works fine, but
Need some help about with Memcache. I have created a class and want to
Need some help to solve this. I have a gridview and inside the gridview
I'm new to this forum, but i came here because i need some help
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help with this problem in implementing with XSLT, I had already implemented
Need some help gathering thoughts on this issue. Our team is moving ahead with
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I need some help from the shell-script gurus out there. I have a .txt
I am hoping to get some help on this issue. Some users on IE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.