这个是iPad访问help页面时,apple官方ipad跳转的JavaScript代码。
function browser_check() {
var originalWindowLocation = window.location + "";
var newWindowLocation;
var server = 'http://' + window.location.hostname + '/ipad';
var regexiPad = new RegExp(/iPad/);
if( regexiPad.exec(navigator.userAgent) ) {
newWindowLocation = server + '/4/interface/';
} else {
newWindowLocation = 'http://support.apple.com/manuals/ipad/';
}
if( -1 == originalWindowLocation.indexOf(newWindowLocation) ) {
window.location = newWindowLocation + window.location.hash;
}
}
browser_check();