live() 的“輸入”事件的支持程度如何 (How well supported is the "input" event for live())


問題描述

live() 的“輸入”事件的支持程度如何 (How well supported is the "input" event for live())

We are using jQuery 1.4.4 on a website and I had a problem which resulted from using the keyup event on a textbox.  The problem was that the user was somehow managing to change the values without actually typing.  I quickly noticed three causes:

  • Autocompletion in the textbox
  • You can drag a value into the text box
  • You can right click ‑> paste values

I had a look around and I noticed that I could use the change event to resolve the problem.  This works fine for autocomplete but it doesn't resolve the problem for dragging values into the textbox. I couldn't get anything to work and then I came across the input event.  

This event seems to resolve all my problems, it's the only event which I need to use to account for keyup, dragging values in and using autocomplete.

My question is simple:  How well is this supported? I can't seem to find any information on it.

Edit: just to clarify, I am aware that live is deprecated, we have to keep the jquery version the same so that won't be affecting us.  Thanks for the consideration though!

‑‑‑‑‑

參考解法

方法 1:

According to https://developer.mozilla.org/en‑US/docs/DOM/DOM_event_reference/input basic support exists for all browsers..

(but in regards to the question title, .live() is deprecated. Use .on() syntax)

(by JamesGabriele Petrioli)

參考文件

  1. How well supported is the "input" event for live() (CC BY‑SA 3.0/4.0)

#jquery






相關問題

讓 jQuery 與 Netscape 7 和 8 一起工作 (Getting jQuery to work with Netscape 7 and 8)

使用 Jquery 的 mvc3 搜索結果 (mvc3 search results with Jquery)

從嵌套的 jquery 函數返回一個值 (Return a value from nested jquery function)

Mencocokkan lebar divisi dengan jquery (Matching division widths with jquery)

無法在 jQuery AJAX 中多次生成點擊事件 (unable to generate click event more than once in jQuery AJAX)

使用雙引號格式並用逗號分隔元素數組 (Implode an element array with double quote format and separated by comma)

選擇不更新 (Select doesn't update)

chrome中帶有省略號的多行文本問題 (issue with multiline text with ellipsis in chrome)

AJAX/PHP/JS - 無法將頁面內容加載到容器中 (AJAX/PHP/JS - Cannot load page content into container)

使用 jQuery 將文本插入 textarea (Insert text into textarea with jQuery)

滾動到頁面底部,僅當用戶在 DOM 操作之前已經位於底部時 (Scroll to bottom of page, only if the user already was at the bottom before DOM manipulation)

如何設置單選按鈕的樣式,使其看起來像普通的可點擊按鈕? (How do I style a radio button to look like a normal clickable button?)







留言討論