打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
JS模拟人工点击链接跳转代码
  • <!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>  
  • 本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
    打开APP,阅读全文并永久保存 查看更多类似文章
    猜你喜欢
    类似文章
    【热】打开小程序,算一算2024你的财运
    JS 判断输入框值是否为空
    Web前端笔试115道题(带答案及解析)
    JS触发Click操作以及获得事件源
    如何使textarea 显示行号
    jQuery+CSS实现的焦点图
    ckeditor 自己写的一个简单的image上传js 运用iframe的ajax上传
    更多类似文章 >>
    生活服务
    热点新闻
    分享 收藏 导长图 关注 下载文章
    绑定账号成功
    后续可登录账号畅享VIP特权!
    如果VIP功能使用有故障,
    可点击这里联系客服!

    联系客服