轉運中國邀請碼批量驗證


最近要海淘,聽說轉運中國不錯,但是不開放注冊,只能通過海淘貝、什么值得買等網站發的邀請碼來進行注冊。無奈狼多肉少,總也搶不到。邀請碼如下圖:

但有時候,他是文字的。於是有了下面的代碼,方便我快速驗證所有的邀請碼。

function runCode(){
	    
	    var strCode = $('#tbCodes').val();
	    var codes = strCode.split('\n');
	    $.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()"/>');

  界面如下:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM