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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:12:34+00:00 2026-06-14T20:12:34+00:00

I want to have fb like button, twitter’s tweet button and G+ equivalent on

  • 0

I want to have fb like button, twitter’s tweet button and G+ equivalent on every page of a website built using JQuery Mobile and not giving up the AJAX transitions.

I can get it work for multipage (linking example0.html#1 to example0.html#2 and back)

I can get working a custom basic javascript (like alert(‘*’);) to be run correct times (showing once at every page, example1.html <-> example2.html). Using jquery .off and .on.

I can get it done switching off the ajax. Works ok example1.html <-> example2.html

However, cannot get it well for the social buttons with ajax and more single pages. The buttons should be shown on every page, e.g. example1.html <-> example2.html

Any working example of any of the social buttons?

(Similar question, however also without working example: Integrating jQuery Mobile with Facebook Like and Twitter Tweet )

Full example, works for 1st (loaded) page, not for the other one.

<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>Title</title> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
</head>
<body>

<div data-role="page" id="page1" data-title="Page 1">
  <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=121542504547391";
      fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));
    </script>
  <div class="fb-like" data-href="http://localhost" data-send="false" data-layout="button_count" data-width="250" data-show-faces="false"></div>
  <a href="#page2" data-role="button" data-icon="arrow-r" data-iconpos="right">Page 2</a>
</div>

<div data-role="page" id="page2" data-title="Page 2">
  <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=121542504547391";
      fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));
    </script>
  <div class="fb-like" data-href="http://localhost" data-send="false" data-layout="button_count" data-width="250" data-show-faces="false"></div>
  <a href="#page1" data-role="button" data-icon="arrow-l">Page 1</a>
</div>

</body>
</html>

  • 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-06-14T20:12:35+00:00Added an answer on June 14, 2026 at 8:12 pm

    Garyv already gave you the correct answer for Facebook:

    FB.XFBML.parse();
    

    To reload the Tweet buttons dinamically, the function you are looking for is:

    twttr.widgets.load();
    

    You should apply both functions after you have loaded your content via ajax.

    UPDATE:

    As per the Google+ button, the answer is:

    gapi.plusone.go();
    

    (Found it here: Google plus-one button on a page that is refreshed with AJAX

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

Sidebar

Related Questions

I have a link that I want to look like a button so I
I have html markup like this <button id=button1 onclick=alert='yup'></button> and I want to make
I want to have different layouts like [left|content|right] and [left|content] or [content|right] when using
I have code like that 010200345 i want split every first three digit please
I have links like these that I want to change: mypage.com?page=missions&id=5 mypage.com?page=hello I tried
I want to have multiple video icons at the top my website's front page.
I have implemented the like button on a website. People have liked the website,
I have a like button that is loaded from ajax on to my page.
I want to have multiple Facebook Like Buttons on a single page, all pointing
I have a like/send button that I've set up on a customer's home page.

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.