zoukankan      html  css  js  c++  java
  • 转运中国邀请码批量验证

    最近要海淘,听说转运中国不错,但是不开放注册,只能通过海淘贝、什么值得买等网站发的邀请码来进行注册。无奈狼多肉少,总也抢不到。邀请码如下图:

    但有时候,他是文字的。于是有了下面的代码,方便我快速验证所有的邀请码。

    function runCode(){
    	    
    	    var strCode = $('#tbCodes').val();
    	    var codes = strCode.split('
    ');
    	    $.each(codes,function(i,code){
    	    	
    	    	var win = window.open(window.location.href,"_blank");
    	    	win.addEventListener('load',function(){
    	    	    console.log('loaded')
    	    	    //debugger;
    	    		$('#aspnetForm').find(':text,:password').each(function(i,n){
    	    			var id = this.id;
    	    			
    	    			var val = $(this).val();
    	    			if(id == 'code'){
    	    				val = code;
    	    			}
    	    				
    	    			
    	    			win.$('#' + id).val(val);
    	    		});
    	    		
    	    		
    	    		win.$('#aspnetForm').get(0).submit();
    	    		
    
    	    		
    	    		
    	    	});
    	    });
    	    
    	  
    	}
    	
    	$(document.body).append('<textarea id="tbCodes"></textarea><input type="button" value="GO" onclick="runCode()"/>');
    

      界面如下:

  • 相关阅读:
    Redis进阶
    redis常用指令
    MarkDown基本语法
    JAVA多线程面试
    使用POI操作Excel
    IDEA+GIT的使用
    获取地址栏的参数
    mybatis逆向工程
    遍历map集合
    springboot批量删除
  • 原文地址:https://www.cnblogs.com/evlon/p/4112538.html
Copyright © 2011-2022 走看看