看板 Ajax 關於我們 聯絡資訊
http://i.imgur.com/hKTGzwZ.jpg 寫匿名動,這樣不動,原因是什麼呢 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.217.153.17 ※ 文章網址: https://www.ptt.cc/bbs/Ajax/M.1448933899.A.BE9.html
Peruheru: function ass() {alert("12300");}; 12/01 10:05
Peruheru: function ass() {alert("12300");}12/01 10:05
Peruheru: 另外你沒有決定input的類型,他是輸入框?按鈕?勾選? 12/01 10:07
Peruheru: 不同的東西對於change事件定義不同12/01 10:07
Peruheru: 文字的change發生在輸入後12/01 10:08
Peruheru: 有些東西不要省略。還有input標籤不需要</input>結尾12/01 10:10
Peruheru: <input type="text" class="inp_ParamValue" /> 12/01 10:10
Peruheru: 這才是input標籤的基本形式12/01 10:10
Peruheru6[m: 你如果使用chrome瀏覽器,按下F12或許就知道為什麼不會 12/01 10:11
Peruheru: 執行了,有錯誤他會告訴你 12/01 10:11
Peruheru: IE或Firefox也是按F1212/01 10:12
washqwe: f12沒顯示錯誤12/01 10:31
Peruheru: F12->選擇console,看有沒有紅色訊息12/01 11:00
washqwe: 將ass function移到ready已ok12/01 11:01
washqwe: js hint 跟f12都沒12/01 11:01
washqwe: 如想將輸入>100自動將其改100該如何呢,因為下圖不動12/01 11:04
washqwe: http://i.imgur.com/qSenCeF.jpg12/01 11:04
※ 編輯: washqwe (180.217.153.17), 12/01/2015 11:05:29
Peruheru: 先參考這個函式,比較前把值丟給這個函式轉成整數 12/01 11:10
Peruheru: 貼錯了 12/01 11:10
washqwe: 好像是$(this).val(100)這段的問題,因在這上之alert都還 12/01 11:15
washqwe: 抓的到數字 12/01 11:15
washqwe: http://i.imgur.com/WDWVtpQ.jpg 12/01 11:24
washqwe: 看他變100後0.1秒內又變回原輸入數字 12/01 11:34
washqwe: attr('value','100')也是 12/01 11:36
washqwe: f12 element內改了100但畫面仍顯示輸入數值 12/01 11:38
Peruheru: 因為你改變他的數值這個行為,也會觸發Change 12/01 12:14
washqwe: 如何可以讓他在大於100自動變100 12/01 12:35
Neisseria: 可以貼 code,像 Pastebin, Github gist 等等 12/02 17:16
Neisseria: 貼圖片,看到 code 也不想重試一次 = =... 12/02 17:16