How do I load the Facebook Like button dynamically? - javascript

I have an overlay which fetches content from another page. This page has a Facebook Like button (the HTML5 version).
What's the best way to initialize the Like button on this page? I tried a simple FB.init() on a script page in the loaded page, but that doesn't seem to work. Suggestions?

OK, got it, this works:
FB.XFBML.parse();

Related

jQuery script keeps redirecting me from a page I'm trying to edit

I was trying to make an application in SharePoint and wanted to make it so that if you click on a button, it redirects you to a page and when that page loads I wanted it to instantly redirect the user to another page. ( I couldn't get the button to just redirect to the page I wanted on click, so that's why I tried doing it this way. ) I did this using a jQuery / JavaScript script. I'm new to making scripts so I was just testing and I ended up making this script:
<script type="text/javascript">
$(document).ready(function(){
Redirect();
});
function Redirect(){
$(document).load("url");
}
</script>
My problem is now that whenever that page loads, it just loads a blank page. But I can't get to the edit screen because it instantly redirects me to a blank page. I tried turning off JavaScript in Google Chrome but even though I was able to load the page without redirecting, I wasn't able to get to the edit page because it's in a jQuery AJAX drop down menu which obviously also doesn't work if JavaScript is turned off.
I would appreciate any help
EDIT: When I say edit screen I mean the place where I can edit the script. To do that I have to press a button on the page, but I can't do that since the page instantly redirects to a blank page.
Use the webpart maintenance page which allows you to remove and manage web parts without visiting the page, the instructions are as below.
Lets say your page is example.com/sites/default.aspx add the query string ?contents=1 to the page it will take you to the manage web parts page you can remove the script editor web part from there.
The other way is to use SharePoint designer to remove the web part this will also help you achieve the same result.

css and jquery not loading properly on ajax requests

I have a web app built using Jquery Mobile. The problem is that from the menu when i click on a link through the menu the css and the jquery doesn't load properly. This happens only when the pages as grabbed through ajax request.
When the ajax request is disabled or page is refreshed the layout gets back to normal
Please check the below link
http://www.vidznet.com/ng1/test/chart.html
From the menu when you click on the profile link you will see the layout is completely messed up. Once refreshed it comes back to normal.
Can someone tell me what might be causing it? I want to make it work without disabling the ajax request to grab the pages.
Any help will be appreciated.
You have a typeo in your link tag in chart.html.
You spelled vendor as endor
The problem was with Jquery UI. Looks like they are not compatible.. Once i removed the Jquery UI It worked

Creating a loading animation between pages on page redirect. VB.net

I am trying to create a loading icon which triggers on a code behind function (Button click) the function redirects to another page. I am trying to find a way of having a loading icon appear on the button click and go away when the second page is loaded.
I have tried using Jquery by hiding the loading icon on page ready using the following function
$('#LoadingIcon').hide()
... in the document ready function.
However the icon doesn't appear until the page is already halfway through its loading process.
Any guidance on how I could solve this would be greatly appreciated.
Please use the following link which may help you to do this. There's a way to do it using a bit of JavaScript.
http://blog.ysatech.com/post/2010/02/06/ASPNET-redirect-a-web-page-with-AJAX-loading-indicator-image

Linking to specific jquery tab from external page

I am using a jquery script called Feature List for displaying different sections of info on a page. The user can click through the various tabs to see different content. It works great for what I want it to do but I was hoping to be able to link to each tab from an external page. The problem is I'm not great with jquery am not sure how to go about this or if it's possible with the way the page is set up.
You can see the page and view the source at http://nourishedbynature.co.uk/
Ideally I'd like to be able to link to the page and display a specific tab by appending something the the url.
Any ideas would be greatly appreciated.
Thanks
Use document.location.hash on $.ready then fire the jQuery code that corresponds to that hash.
$.ready(function(){
gotosectionforhash(document.location.hash);
});

Reparse Google Plus Button?

I have a website where pages are loaded via AJAX so I reload the Facebook comments box and like button (FB.XFBML.parse()) each time a link is opened. I was wondering if there is a similar way to reload the Google Plus button with JavaScript for a page.
Parsetags should be set to explicit.
See: https://developers.google.com/+/plugins/+1button/
Then you can call gapi.plusone.go(); to have the tags re-parsed.

Categories

Resources