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