A temporary workaround for bind binding events and text box change events in jquery

Source: Internet
Author: User

Temporarily did not think of any good solution, I now add a browser to judge non-ie to register the blur event, so there is a problem is blur real other control activity focus, Txtstation control registration method is to fill it next to a drop-down list
Have no interest to see jquery, with their own little bit of JavaScript to endure, today write a function to try, register the event with bind found how not good to make $ ("#txtStation"). Bind ("Onpropertychange ", Getstationlevel);

Copy the code and then the onclick like all tried, not a can use, helpless to turn the jquery API, are the birds of the bird I also can not understand the specific point, but found that the bind registration event is not on. Found a change event and tried it
The code is as follows: $ ("#txtStation"). Change (function () {alert (' Change ')});

Copy code discovery is to wait until the loss of focus to activate the same as onchange, I do not use this.
Try to hold the idea I just onpropertychange in front of the delete, anyway, HTML, regardless of itself is written to support unsupported events as long as you write up probably all the way. I didn't expect it to be. IE is no problem, now do not talk about cross-browser ah Firefox I also have to be able to use AH.
Firefox said with Oninput event, I tried not to work, oninput only in the input value will be excited, I this input box is with induction, that is, the kind of loss of a word to the beginning of the word induction can choose that, the choice of induction of the words oninput will not inspire.
Temporarily did not think of any good solution, I now add a browser to judge non-ie to register the blur event, so there is a problem is blur real other control activity focus, Txtstation control registration method is to fill it next to a drop-down list, This completes the Txtstation content to choose the drop-down list when the blur is fired, there are two refreshes appear, no big impact, but the first time the user clicked invalid. Who has a good way to give me a sound.

Code if ($.browser.msie)

{

$ ("#<%=txtstation.textboxid%>"). Bind ("PropertyChange", getstationlevel);

}

Else

{

$ ("#<%=txtstation.textboxid%>"). Bind ("blur", Getstationlevel)

}

A temporary workaround for bind binding events and text box change events in jquery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.