googleajaxurls
v0.1.0
Published
Library for converting to and from the urls used by Google's ajax crawling specification (https://developers.google.com/webmasters/ajax-crawling/docs/specification)
Downloads
4
Readme
Googleajaxurls
Convert to and from the url format required by the Google's Ajax Crawling Specification.
http://domain.com/#!key1=value1&key2=value2becomes
http://domain.com/?_escaped_fragment_=key1=value1%26key2=value2Usage
Hashbang Mode
var googleajaxurls = require('googleajaxurls')({hashbangMode: true}),
startUrl = 'http://domain.com/#!one/two/three';
googleajaxurls.toEscapedFragment(startUrl); // --> http://domain.com/?_escaped_fragment_=one%2Ftwo%2Fthree
googleajaxurls.fromEscapedFragment(googleajaxurls.toEscapedFragment(startUrl)); // --> http://domain.com/#!one/two/threeNormal Mode
var googleajaxurls = require('googleajaxurls')(),
startUrl = 'http://domain.com/one/two/three';
googleajaxurls.toEscapedFragment(startUrl); // --> http://domain.com/one/two/three?_escaped_fragment_=
googleajaxurls.fromEscapedFragment(googleajaxurls.toEscapedFragment(startUrl)); // --> http://domain.com/one/two/three