作者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/cn.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