I want to add "Google +1" button to my website. I add elements
<html itemscope itemtype="http://schema.org/Other">
<meta itemprop="name" content="title">
<meta itemprop="description" content="erterter">
<meta itemprop="image" content="http://www.mmaer.com">
to my page. It works fine on single-language page, but works incorrectly in multilanguage case. My page defines language of page by language of browser and description fills depend on this language. So, even I see code of page:
<meta itemprop="name" content="Magic Screenshot">
<meta itemprop="description" content="Russian text">
<meta itemprop="image" content="http://www.magicscreenshot.com/Content/Images/error_FileNotFound_small.jpg">
when I click on "Google +1" I see english text. How to fix it?
I'm adding this button by following code
<div style="text-align: right;">
<div class="g-plusone" data-size="medium" data-annotation="inline" data-width="300" data-href="http://wwww.com"></div>
<script type="text/javascript">
window.___gcfg = { lang: 'ru' };
(function () {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
Related
I have set my og tags as I should. Facebook debugger tool shows the correct tags and generates the correct share preview. However the sharebutton on my site generates a different result. It adds an h2 header tag with the title and there is no summary.
My code:
<meta property="og:title" content="Page-Title"/>
<meta property="og:url" content="Page-URL"/>
<meta property="og:image" content="Page-Image"/>
<meta property="og:description" content="Page-Description" />
Initializing facebook share button
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v2.5'
});
};
(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/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
It looks like you are missing the type meta property and the html of the button itself.
It should be:
<html>
<head>
<title>Your Website Title</title>
<!-- You can use Open Graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="http://www.your-domain.com/your-page.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Your Website Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="http://www.your-domain.com/path/image.jpg" />
</head>
<body>
<!-- Load Facebook SDK for JavaScript -->
<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/sdk.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your share button code -->
<div class="fb-share-button"
data-href="http://www.your-domain.com/your-page.html"
data-layout="button_count">
</div>
</body>
</html>
I am trying to fetch and display a map from the arcgis server using Aptana IDE. It says l is undefined.
GET https://gistest2.xxx.xxx/arcgis/rest/info?f=json
200 OK 27ms TypeError: l is undefined
...x)<=p.dx)&&q._addFrameInfo(h,p);this.setExclusionAreas(this.exclusionAreas);this...
Here is the entire code except the URL I am trying to hit.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>BGSU Memorial Trees Location</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<script src="http://js.arcgis.com/3.10/">
</script>
<script>
var map;
require(["esri/map", "esri/layers/ArcGISTiledMapServiceLayer", "dojo/domReady!"],
function (Map, ArcGISTiledMapServiceLayer ) {
map = new Map("map", {
center: [-76.756, 40.241],
zoom: 8
});
var customBasemap = new ArcGISTiledMapServiceLayer(
"https://XXX/");
map.addLayer(customBasemap);
});
</script>
</head>
<body class="claro">
<div align="center"><strong>BGSU Memorial Trees Listing </strong><hr>
<i><a target="_self" href="listingtrees.html">Listing</a> | <a target="_self" href="locationtrees.html">Locations </a></i>
</div>
<br>
<div id="map" >
</div>
</body>
</html>
Any help is highly appreciated.
Thanks in Advance!
In the constructor of ArcGISTiledMapServiceLayer you have to specify the URL of an ArcGIS tiled map service. Example of URL:
http://myserver/arcgis/rest/services/map_service_name/MapServer
The address you specified (arcgis/rest/info?f=json) is the address of the REST service of ArcGIS Server but doesn't point to a Map service.
I'm using the Google+ share plugin which simultaneously does a +1 and a share.
Unfortunately, I cannot get the image that I specify to appear.
I was using an image that is 200px by 200px which complies with the size requirements. I can get the name and the description to display as specified.
The following is the code that I'm using:
<!DOCTYPE html>
<html itemscope itemtype="http://schema.org/Vacancy">
<head>
<meta itemprop="name" content="Vacancy">
<meta itemprop="description" content="A new job vacancy etc">
<meta itemprop="image" content="https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcQBafMb42NGLi-C-NEmdC-RQDJ5t8PRahD4uTdpOuSAnD5_gMU1_g">
</head>
<body>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</body>
</html>
All works fine except that the correct image is not displayed on the +1 share.
Any help in this regard would be very much appreciated.
Many thanks,
Mary
The code you've supplied is working for me. An image of a cat that is 160px square is showing up in your snippet.
This is my code which i have added inside head of my website eravikant.com
<meta itemprop="name" content="MySMSBuddy">
<meta itemprop="description" content="Description of my webpage">
<meta itemprop="image" content="http://eravikant.com/images/image.png">
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
and code which which will show google+ icon for +1 is
<div align="right"><g:plusone size="medium" callback="MySMSBuddy" href="http://eravikant.com/images/image.png"></g:plusone></div>
But, when i click on +1. then only image of my website has share not description and title..
Need help !!!
You need itemscope itemtype="http://schema.org/Article" in your HTML tag:
<html itemscope itemtype="http://schema.org/Article">
</html>
<head>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=http://rgksugan.in/"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"><iframe>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId:'194541653919499', cookie:true,
status:true, xfbml:true
});
</script>
<fb:login-button>Login with Facebook</fb:login-button>
</body>
<html>
This is my HTML page. I am expecting a Login with Facebook button in my page. But it doesnot appear. What is the problem?
Hi are you embdding facebook connect code in your html tag? Other thing you have to load your jsdk either synchronously or asynchronously. Put the code of like button after that. First make your html tag like this
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en">
and then try this just after your <body> tag
<body>
window.fbAsyncInit = function() {
FB.init({
appId:'194541653919499', cookie:true,
status:true, xfbml:true
});
};
(function() {
var e = document.createElement("script");
e.type = "text/javascript";
e.src = document.location.protocol +
"//connect.facebook.net/en_US/all.js";
e.async = true;
document.getElementById("fb-root").appendChild(e);
}());
</script>
Use this code for your like button. Your third problem is that you are having two facebook connect statements in your code. When you have connected with facebook using a asynchronously then you dont need to connect again when you are putting like button code. use this code
<fb:like href="http://rgksugan.in/" show_faces="true" width="450" font=""></fb:like>
iframe end tag of your like button is not well formatted.
Change
<iframe src="http://www.facebook.com/plugins/like.php?href=http://rgksugan.in/"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"><iframe>
to
<iframe src="http://www.facebook.com/plugins/like.php?href=http://rgksugan.in/"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>