/ Published in: JavaScript
Expand |
Embed | Plain Text
/* Normalize the URL. javascript: var parameter, search = "?haspic=1&reservePrice=1"; parameter = /display=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : "&display=image"; parameter = /s=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : "&s=curprice"; parameter = /(\d+)/.exec(location.pathname) || /cat=([^&]+)/.exec(location.search); search += parameter ? "&cat=" + parameter[1] : ""; parameter = /seller=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : ""; parameter = /p=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : ""; location.href = "http://tw.search.bid.yahoo.com/search/ac" + search; */ var parameter, search = "?haspic=1&reservePrice=1"; parameter = /display=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : "&display=image"; parameter = /s=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : "&s=curprice"; parameter = /(\d+)/.exec(location.pathname) || /cat=([^&]+)/.exec(location.search); search += parameter ? "&cat=" + parameter[1] : ""; parameter = /seller=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : ""; parameter = /p=[^&]+/.exec(location.search); search += parameter ? "&" + parameter[0] : ""; location.href = "http://tw.search.bid.yahoo.com/search/ac" + search; /* Get the shortest URL. javascript: prompt("", "http://bid.yahoo.com.tw/auction/" + ( /aID=([^&]+)/.exec(location.search) || /([^/]+$)/.exec(location.pathname) )[1]); undefined; */ prompt("", "http://bid.yahoo.com.tw/auction/" + ( /aID=([^&]+)/.exec(location.search) || /([^/]+$)/.exec(location.pathname) )[1]); undefined; /* Scroll between the page header and the content pictures. javascript: location.href = location.hash ? /[^#]+/.exec(location.href)[0] : location.href + "#upiv"; undefined; */ location.href = location.hash ? /[^#]+/.exec(location.href)[0] : location.href + "#upiv"; undefined; /* Scroll between the page header and the content pictures. javascript: location.hash = location.hash == "#upiv" ? "#bd" : "#upiv"; undefined; */ location.hash = location.hash == "#upiv" ? "#bd" : "#upiv"; undefined; /* Scroll between the page header and the content pictures. javascript: location.hash = location.hash ? "" : "#upiv"; if (!location.hash) document.images[0].scrollIntoView(); undefined; */ location.hash = location.hash ? "" : "#upiv"; if (!location.hash) document.images[0].scrollIntoView(); undefined; /* Add a link to the content picture to the thumbnail, and links to the page header to the content pictures. javascript: addLink(document.images[document.getElementById("myfav_panel") ? 7 : 5], "#upiv"); var images = document.getElementById("upiv").getElementsByTagName("img"); for (var cx = 0; cx < images.length; cx++) addLink(images[cx], "#bd"); function addLink(node, href) { var a = document.createElement("a"); a.href = href; a.appendChild( node.cloneNode(false) ); node.parentNode.replaceChild(a, node); undefined; } */ addLink(document.images[document.getElementById("myfav_panel") ? 7 : 5], "#upiv"); var images = document.getElementById("upiv").getElementsByTagName("img"); for (var cx = 0; cx < images.length; cx++) addLink(images[cx], "#bd"); function addLink(node, href) { var a = document.createElement("a"); a.href = href; a.appendChild( node.cloneNode(false) ); node.parentNode.replaceChild(a, node); }
You need to login to post a comment.
