开发者

Facebook share with AJAX meta tags

开发者 https://www.devze.com 2023-03-31 08:49 出处:网络
This page, when put in Facebook status textbox, grabs t开发者_C百科he thumbnail, description and page title with my name and thumbnail into the Facebook Sharer textbox:

This page, when put in Facebook status textbox, grabs t开发者_C百科he thumbnail, description and page title with my name and thumbnail into the Facebook Sharer textbox:

https://twitter.com/#!/ftwolf

However, it is obviously an AJAX-loaded page (as you can tell by the hash fragment URL). How can I accomplish the same thing on a page that loads via AJAX?


You can use jQuery (Twitter users jquery, too, probably) and its plugin address. It has very simple implemention

        $.address.init(function(event) {
            // Initializes plugin support for links
            $('a:not([href^=http])').address();
        }).change(function(event) {
            //do your stuff
        });


The Facebook crawler should work the same way as google's.

You can test your implementation with the Facebook linter

0

精彩评论

暂无评论...
验证码 换一张
取 消