Your Ad Here

Posted By

f on 01/31/09


Tagged

siteDependent


Versions (?)

奇摩拍賣


 / Published in: JavaScript
 

URL: http://bid.yahoo.com.tw/

  1. /* Normalize the URL.
  2. 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;
  3.  */
  4. var parameter, search = "?haspic=1&reservePrice=1";
  5. parameter = /display=[^&]+/.exec(location.search);
  6. search += parameter ? "&" + parameter[0] : "&display=image";
  7. parameter = /s=[^&]+/.exec(location.search);
  8. search += parameter ? "&" + parameter[0] : "&s=curprice";
  9. parameter = /(\d+)/.exec(location.pathname) || /cat=([^&]+)/.exec(location.search);
  10. search += parameter ? "&cat=" + parameter[1] : "";
  11. parameter = /seller=[^&]+/.exec(location.search);
  12. search += parameter ? "&" + parameter[0] : "";
  13. parameter = /p=[^&]+/.exec(location.search);
  14. search += parameter ? "&" + parameter[0] : "";
  15. location.href = "http://tw.search.bid.yahoo.com/search/ac" + search;
  16.  
  17. /* Get the shortest URL.
  18. javascript: prompt("", "http://bid.yahoo.com.tw/auction/" + ( /aID=([^&]+)/.exec(location.search) || /([^/]+$)/.exec(location.pathname) )[1]); undefined;
  19. */
  20. prompt("", "http://bid.yahoo.com.tw/auction/" + ( /aID=([^&]+)/.exec(location.search) || /([^/]+$)/.exec(location.pathname) )[1]);
  21. undefined;
  22.  
  23. /* Scroll between the page header and the content pictures.
  24. javascript: location.href = location.hash ? /[^#]+/.exec(location.href)[0] : location.href + "#upiv"; undefined;
  25. */
  26. location.href = location.hash ? /[^#]+/.exec(location.href)[0] : location.href + "#upiv";
  27. undefined;
  28.  
  29. /* Scroll between the page header and the content pictures.
  30. javascript: location.hash = location.hash == "#upiv" ? "#bd" : "#upiv"; undefined;
  31. */
  32. location.hash = location.hash == "#upiv" ? "#bd" : "#upiv";
  33. undefined;
  34.  
  35. /* Scroll between the page header and the content pictures.
  36. javascript: location.hash = location.hash ? "" : "#upiv"; if (!location.hash) document.images[0].scrollIntoView(); undefined;
  37. */
  38. location.hash = location.hash ? "" : "#upiv";
  39. if (!location.hash) document.images[0].scrollIntoView();
  40. undefined;
  41.  
  42. /* Add a link to the content picture to the thumbnail, and links to the page header to the content pictures.
  43. 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; }
  44. */
  45. addLink(document.images[document.getElementById("myfav_panel") ? 7 : 5], "#upiv");
  46.  
  47. var images = document.getElementById("upiv").getElementsByTagName("img");
  48. for (var cx = 0; cx < images.length; cx++)
  49. addLink(images[cx], "#bd");
  50.  
  51. function addLink(node, href)
  52. {
  53. var a = document.createElement("a");
  54. a.href = href;
  55. a.appendChild( node.cloneNode(false) );
  56. node.parentNode.replaceChild(a, node);
  57. }

Report this snippet  

You need to login to post a comment.