驗證碼重新讀取
今天在玩網頁登入加入驗證碼,可是在重新讀取時一直沒有作用,後來查網才知道,因為 src 沒有改變,所以不會重新執行
原來 img 的 jquery$("#getcode_num").click(function(){
$(this).prop("src", "captcha/code_num.php" ); })
//沒有作用,因為 src = "captcha/code_num.php" 永遠一樣.,不會改變
改成
$("#getcode_num").click(function(){
$(this).prop("src", "captcha/code_num.php?code=" + Math.random()); });
//改變,因為 src = "captcha/code_num.php?code=" + Math.random()); 因為 random每次改不一樣的值,code 參數隻是讓 src 不一樣,在後端不用處理
迴響
驗證碼重新讀取 | 豬窩
Have yoou everr thought about including a llittle bit more than just your articles?
I mean, whaqt yyou say is imporfant and everything. Howwver
thnk of if you adde some reat images orr videos
to give your postys more, "pop"! Yoour content is excelllent butt with images aand
clips, this siote could unddeniably bbe one oof the est in itts niche.
Awesom blog!
驗證碼重新讀取 | 豬窩
What's Hapening i'm nnew tto this, I stumbbled upon this I've discoverd It absolutely useful
and it has helped mee oout loads. I'm hopping to contribute
& aid othwr customers lijke its helped me. Good job.
驗證碼重新讀取 | 豬窩
Hi, I want too subscribe ffor this log tto obtan mos recent updates, thereftore wherde
cann i doo it lease help out.