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 6803107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:18:15+00:00 2026-05-26T19:18:15+00:00

After I integrate the Facebook Invite Friends plug-in, the first time it’s loaded in

  • 0

After I integrate the Facebook Invite Friends plug-in, the first time it’s loaded in any browser, it works fine, but when I try it second time (after a refresh or something) it just doesn’t open anymore. I keep clicking but it just doesn’t open.

This is the code:

function showPopup(pageURL, title, w, h) {
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}

window.fbAsyncInit = function () {
    FB.init({
        //   appId      : 'my app id', // App ID
        //  channelURL : '//WWW.mydomain.COM/domainfolder/channel.php', // Channel File
        status: true,
        // check login status
        cookie: true,
        // enable cookies to allow the server to access the session
        oauth: true,
        // enable OAuth 2.0
        xfbml: true // parse XFBML
    });
    // Additional initialization code here
};

// Load the SDK asynchronously
(function (d) {
    var js, id = 'facebook-jssdk';
    if (d.getElementById(id)) {
        return;
    }
    js = d.createElement('script');
    js.id = id;
    js.async = true;
    js.src = "//connect.facebook.net/en_US/all.js";
    d.getElementsByTagName('head')[0].appendChild(js);
}(document));
//Replace the ALL_CAPS variables with your own values

function invite() {
    FB.getLoginStatus(function (response) {
        if (response.authResponse) {
            // logged in and connected user, someone you know
            FB.ui({
                method: 'fbml.dialog',
                width: '750px',
                fbml: '<fb:request-form target="_self" method="post" invite="true" type="Invite" content="Hey! Come join me on this site! Finally it\'s opened for us! <fb:req-choice url=\'http://www.mysite.com/site/index.php\' label=\'Accept\' />" <fb:multi-friend-selector showborder="false" actiontext="Invite friends" email_invite="true" import_external_friends="true" /> </fb:request-form>'
            });
        } else {
            // no user session available, someone you dont know
            FB.login();
        }
    });
}
function loaded() {
    document.getElementById('FBico').src = 'img/OtherServices/fb.png';
}

It’s in the head tag. It works perfectly the first time after clearing the history. Same happened in Internet Explorer 9, Firefox 8, Chrome and iPad iOS 5.

The all.js file from Facebook may get cached somewhere and not loading again. There is one little file with only /html/body/ above code /body//html/ which works all the time perfectly.

How can I prevent caching the all.js file from Facebook?

  • 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-26T19:18:16+00:00Added an answer on May 26, 2026 at 7:18 pm

    ok so i finally figured it out. the invite() function was being called when an image (facebook icon) was clicked. so the browsers were thinking that its an ad and 2nd time the invite() function was not being called.
    so after i replaced the tag with a button everything worked fine and facebook invite window opens up in all browsers without any problem.

    btw, why my question got thumbs down? no one could answer the question? meh…

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

Sidebar

Related Questions

My Facebook app runs fine initially. But after a certain amount of inactivity, I
After I click update in the grid view, the code works successfully. But when
I am trying to integrate facebook in my iphone application. after logged in from
I'm trying to integrate facebook login on a site I'm working on, but so
I'm learning how to integrate facebook api in iphone app. First I visited facebook
I'm thinking of using Spring Social to integrate with Facebook, but I've never done
What ways to invite user friends on facebook connected website you know? During last
After discovering about Javascript namespaces, I tried to implement them but I run into
After some time researching and trying different things I still cannot get my @ExceptionHandler
After adding Restkit to the Podfile : platform :ios dependency 'Facebook-iOS-SDK', '1.2' dependency 'RestKit',

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.