Reparse Google Plus Button? - javascript

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.

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.

chrome extension opens with page load

I need to create a chrome extension that for every web page te he user opens - he will have a button on top of the page (similar to the google translate extension - just that it will appear with page load, without the need to press a button) - preessing on it will do some activity.
from what i saw - the way to do it is to create a content script that will add an iframe that includes the button on the window.onload. just before i do that - i want to be sure there is no more simple way of doing that.
Thanks.
There is an experimental infobar API, but it's unknown when, if ever, it becomes stable.
As-is, you really need to inject your UI into the page DOM from a content script, with an iframe being a good solution to separate your UI from the page.
If it's just a button for each page then you could use a Browser Action
If you'd like for it to actually be in the page then an iframe is a good way to go.

How to reload an embedded tweet button

On website foradacopa.com and most websites I develop, we load partial page content into the current DOM to create a "one page" website experience. When these partial pages have embedded tweet buttons, the first page loaded will display the tweet button properly whereas subsequent pages loaded will not. This is because the Twitter code only does it's magic once, when the code is loaded initially.
To workaround this, you need to manually call a method that will do the magic to turn your static a tag into the iframe embedded button.
twttr.widgets.load()
I found this answer at https://dev.twitter.com/discussions/5642 from #kurrik Arne Roomann-Kurrik.

How do I load the Facebook Like button dynamically?

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();

When I click on Refresh button on IE my javascript getting refresh -how to stop it

I developed a website using Javascript and HTML pages
Problem :
When i am clicking on refresh button on Internet Explore, it is going to home page instead of refreshing the current page of my web page. please do the need full
Regards
Santosh
This usually happens when you are using ajax to update parts of the website after loading.
Ex: Say clicking on add button loads a form using ajax.
When you do like this the URL in the browser remains same even after loading the form. Because of this hitting the refresh button will not take you to form again.
Solution:
Really Simple History (RSH) is lightweight JavaScript library for the management of bookmarking and browser history in Ajax/DHTML applications.
Use this library to update the browser URL after the ajax request. Now the refresh should work fine.
Hope this helps.

Categories

Resources