Jquery: Returning Value From Trigger

后端 未结 6 799
轮回少年
轮回少年 2021-02-02 10:14

I am using a trigger call a get a value from custom event but I want it to return a value and its only giving me Object Object when I do the following call:

var          


        
6条回答
  •  春和景丽
    2021-02-02 10:17

    A trigger cannot return a response, because it's a callback method.

    In addition jQuery have a fluid API, so .trigger() returns always $(this).
    You can write $("#my_id").trigger(something).show().on(someelse)...

提交回复
热议问题