How come $(this) is undefined after ajax call

前端 未结 5 1784
无人共我
无人共我 2020-12-21 15:38

I am doing an ajax request when an anchor tag is clicked with an ID set to href. Btw, this anchor tag is dynamically created.



        
5条回答
  •  悲&欢浪女
    2020-12-21 16:25

    Scope change inside the function.

    Cache the link object and refer to it inside of the ajax request.

提交回复
热议问题