jQuery .find() on data from .ajax() call is returning “[object Object]” instead of div

前端 未结 17 1355
一生所求
一生所求 2020-12-07 22:05

Trying to find div element with id=\"result\" in returned data from .ajax() using .find(). Unfortunately, alert(res

17条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 22:43

    You might have to do something like

    var content= (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d
    

    then you should be able to use

    result = $(content).find("#result")
    

提交回复
热议问题