2013-06-28 121 views
0

我的页面上有一个Google+和Facebook Like按钮。我有他们需要的脚本和动态设置数据属性。但是当我点击分享按钮或像按钮,它随着随机图像和标题打开。我有元标记为他们识别标题,图像和描述我想使用,但不知何故,他们没有拿起元标记。facebook,google +分享按钮无法识别我的meta标记

下面是从Facebook开发调试工具

fb:admins and fb:app_id tags are missing. These tags are necessary for Facebook to render a News Feed story that generates a high click-through rate. 
og:title is missing. The og:title meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. 
og:type is missing. The og:type meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. 
og:image is missing. The og:image meta tag is necessary for Facebook to render a News Feed story that generates a high click-through rate. 

渲染Meta标签在HTML中的错误

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:og="http://opengraphprotocol.org/schema/" 
itemscope itemtype="http://schema.org/Product"> 

    <meta content="No appointment necessary. We hear you coming" name="og:title"> 
    <meta content="http://www.mysite.com" name="og:site_name"> 
    <meta content="blog" name="og:type"> 
    <meta content="http://www.mysite.com/entries/viewentry.aspx" name="og:url"> 
    <meta content="http://static.mysite.com/Images/imag21.jpg" name="og:image"> 
    <meta content="447438772019226" name="fb:app_id"> 
    <meta content="Temp title and some descriptions" name="description"> 

Facebook的脚本

<div class="facebookShare"> 
     <div class="fb-like" data-font="verdana" data-href= 
     '<%= currentPageURL.Value %>' data-layout="box_count" data-send="true" 
     data-show-faces="true" data-width="500"></div> 
    </div> 

// currentPageURL is a hidden field which sets the URL fine. 

(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_GB/all.js#xfbml=1"; 
    fjs.parentNode.insertBefore(js, fjs); 
}(document, 'script', 'facebook-jssdk')); 

Google+的分享按钮脚本

<div class="googlePlusShare col span_1_of_12"> 
     <!-- Place this tag where you want the share button to render. --> 
     <div class="g-plus" data-action="share" data-annotation= 
     "vertical-bubble" data-height="60" data-href='<%= currentPageURL.Value %>'</div> 
    </div> 

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

渲染HTML的两个

<div class="fb-like fb_edge_widget_with_comment fb_iframe_widget" 
    data-font="verdana" data-href="http://www.mysite.com/viewentry.aspx?entryId=6" 
    data-layout="box_count" data-send="false" data-show-faces="true" 
    data-width="500"> 
    </div> 

// Google+的替换整个html和我data-href属性,以及把一些代码在那里,我没有看到我的当前页面的URL。至少我可以看到,在Facebook标签

但是,点击时不会拉我的元标签信息。请帮忙。

回答