Published in: JavaScript
http://www.imdb.com/help/show_leaf?datatopfaq#footer
http://www.imdb.com/help/show_leaf?datatopfaq#
http://www.imdb.com/help/show_leaf
http://www.imdb.com/help/
http://www.imdb.com/
http://imdb.com/
http://www.imdb.com/
http://imdb.com/
......
/* if(location.href.search(/\?/)!=-1){obj=location.href.match(/[^?]+/);}else{obj=location.href.replace(/\/$/,'').match(/.*\//);}if(obj!='http://'){location.href=obj;}else{if(location.hostname.match(/^www\./)==null){location.hostname='www.'+location.hostname;}else{location.hostname=location.hostname.replace(/www\./,'');}}undefined; */ javascript: var obj = location.href; if (obj.replace(/#$/,'').search('#') != -1) { obj = obj.match(/.+#/); } else if (obj.search(/\?/) != -1) { obj = obj.match(/[^?]+/); } else { obj = obj.replace(/\/$/,'').match(/.*\//); } if(obj == 'http://') { if(location.hostname.match(/^www\./) == null) { location.hostname = 'www.' + location.hostname; } else { location.hostname = location.hostname.replace(/www\./,''); } } else { location.href = obj; } undefined;
You need to login to post a comment.
