Ajax functions cannot be called with this, while ajax functions can be called with this

Source: Internet
Author: User

Ajax functions cannot be called with this, while ajax functions can be called with this
Some time ago, I saw a similar saying in my blog, but I didn't care about it at the time. Today I met it. Mark it, in the ajax return method, this call does not work, that is, $ (this) cannot obtain any value. The correct method is $ ('# div') to obtain the elements you want to operate.
I cannot identify $ (this) in Jquery ajax ?? The Code is as follows:

It cannot be used. Get the variable var mythis = $ (this) out of ajax and use it in it.

Ajax asynchronous call, callback function problems, this Is Not Defined

In updateEvent (), this indicates the method itself. this. myState indicates the myState parameter in updateEvent (), but you have not defined it in this method.
In <input type = "text" onclick = "a (this. value)"/>, this indicates the text box itself, so the value attribute is default and does not need to be written.
This is my opinion ..

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.