日期:2014-05-16 浏览次数:20318 次
<html> <head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>URL转换</title> </head> <body> <p>用于 <a href="http://goxiazai.cc/"> http://goxiazai.cc/</a> MAC下载无法获取迅雷url的转换</p> 输入URL :</p> <textarea id="urlText" type="text" name="url" rows="5" cols="100"> http://goxiazai.cc/xiazai.html?cid=8C1A3F3F9D6BD0CCE606AC73E8B22231B1D4B1D1&f=thunder%3a%2f%2fQUFodHRwOi8vZ2d4eHh6enouY29tOjgwODkvW2dveGlhemFpLmNjXVsyMDEyw8C5%2btfu0MKwrMLqoaTO1smtuN%2b31sfgtLqwrsfps8mzpF1bsdq7qMnZxOpdWzcyMFC438flXVvW0NOiy6vX1l1bSU1EQiA4LjRdW9G4wNfPwtTYXS5ybXZiWlo%3d </textarea></p> <button onclick="urlFunction()">Submit</button></p> <p>结果:</p> <textarea id="result" type="text" name="url" rows="5" cols="100"></textarea> <script> function urlFunction() { var result = "input url error"; var url = document.getElementById("urlText").value; var start = url.indexOf("thunder"); if (start > 0) { url = url.substr(start); result = decodeURIComponent(url); } document.getElementById("result").innerHTML = result; } </script> </body> </html>