Bind bind events in jquery and temporary workaround for text box change events _jquery

Source: Internet
Author: User
have been not interested in looking at jquery, using their own that little bit of JavaScript to endure, today to write a function to try, with BIND registration event found how all bad
Copy Code code as follows:

$ ("#txtStation"). Bind ("Onpropertychange", getstationlevel);

Then the onclick and so on have tried, no one can use, but to go over jquery's API, are the birds of the bird I can not understand the specific point, but found that the BIND registration events are not on.
Found a change event and tried it.
Copy Code code as follows:

$ ("#txtStation"). Change (function () {alert (' Change ')});

The discovery is to wait until lost focus will be activated like onchange, I can not use.
Hold on to the idea of a try I'll take it. Onpropertychange front of the on deleted, anyway HTML regardless of its written support for unsupported events as long as you write up may be good. I didn't expect it to be. IE is no problem, now do not speak across the browser Ah, Firefox, we also have to be able to use AH.
Firefox is said to use the Oninput event, I tried not to do well, oninput only in the input value will be excited, I this input box is inductive, is that kind of lose a word to the beginning of the word are induction can choose that kind of, select the item words oninput will not inspire.
Temporarily did not think of any good solution, I now add a browser to judge non ie words on the registration blur event, so there is a problem is blur really other control activity focus, Txtstation control registration method is to fill it next to a drop-down list, This is done after the Txtstation content to select the Drop-down list to stimulate the blur, there are two times refresh appeared, no big impact, but the user first click invalid. Who has a good way to tell me.

Code
Copy Code code as follows:

if ($.browser.msie)
{
$ ("#<%=txtstation.textboxid%>"). Bind ("PropertyChange", getstationlevel);
}
Else
{
$ ("#<%=txtstation.textboxid%>"). Bind ("blur", Getstationlevel)
}

Look at the front seems to have not written what content, the title is quite imposing, haha. Write it for fear of forgetting yourself.

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.