<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JS模拟人工点击网址跳转</title> <script> function getval() { var name,value,i; var str=location.href; var num=str.indexOf("?"); str=str.substr(num+1); var arrtmp=str.split("&"); for(i=0;i < arrtmp.length;i++){ num=arrtmp[i].indexOf("="); if(num>0){ name=arrtmp[i].substring(0,num); value=arrtmp[i].substr(num+1); if(name=='url') { var e = document.createElement("a"); e.href = value; e.innerHTML=''; document.getElementsByTagName("body")[0].appendChild(e); e.click(); } } } } getval(); </script> </head> <body> <p>http://www.micxp.com/url.html 为当前页面</p> <p>http://www.blog.micxp.com 为目标页面</p> <p>例子:http://www.micxp.com/url.html?='http://www.blog.micxp.com'</p> </body> </html>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。