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

  • Home
  • SEARCH
  • 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 6167855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:35:09+00:00 2026-05-23T22:35:09+00:00

I’m trying to use the ‘edge.create’ callback function of the Facebook javascript SDK to

  • 0

I’m trying to use the ‘edge.create’ callback function of the Facebook javascript SDK to send an alert when a user clicks the like button on a page. Ultimately my goal is to have it regenerate styles on the page so that it can resize the facebook widget div dynamically when clicked. I cannot get the callback to work even for the alert though.

<html lang="en">
<head>
    <title></title>
    <script   src="http://connect.facebook.net/en_US/all.js#appId=216985861663967&amp;xfbml=1"></script>
    <script>
        FB.Event.subscribe('edge.create', function() {
            alert('Liked');
        });
    </script>
</head>
<body>
<div id="fb-root"></div>
<fb:like send="false" layout="button_count" show_faces="false" font=""></fb:like>

</body>
</html>

Any ideas why this isn’t working? When the button is clicked it gives the error:

Unsafe JavaScript attempt to access frame with URL

and later says Domains, protocols and ports must match.

  • 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-23T22:35:10+00:00Added an answer on May 23, 2026 at 10:35 pm

    From your description I’m guessing you’re testing in Chrome/Safari on a local server?

    Chrome/Safari

    Try setting your Like Button URL to an existing Web address:

    <fb:like href="http://google.com" ...
    

    An important note is that the alert depends on the Like’s success, which depends on the URL being reachable by Facebook. You won’t be able to Like a URL that only exists on your local server (ex. http://localhost:3000/my-page.html). Obviously Liking Google is a test fix; you can instead push your code to a staging server for the same effect, but it takes more time and effort.

    When I make this change the Like Button and alert work in Chrome 12 for Mac, but I still see the same error as you. I think Chrome is just sensitive with iframes; I doubt the error can be avoided.

    Firefox

    If I make the above change, it still doesn’t work in Firefox 5 for Mac. I get the error e.root is undefined from Facebook’s all.js and the Like Button doesn’t even appear.

    If I move the all.js and FB.Event.subscribe() scripts below the fb-root div, the Like Button shows up and the alert works with no errors.

    Internet Explorer

    According to Facebook’s documentation you need to add Facebook’s XML namespace to your <html> tag for the button to render in Internet Explorer:

    <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.