Uncaught TypeError: Cannot read property 'ownerDocument' of undefined

前端 未结 6 1210
生来不讨喜
生来不讨喜 2020-12-29 01:57

I\'m teaching myself AJAX to AJAXify my site. In my template, I have the following JS code to get some JSON data from a view then append the data to a div.

f         


        
6条回答
  •  暖寄归人
    2020-12-29 02:13

    Make sure you're passing a selector to jQuery, not some form of data:

    $( '.my-selector' )
    

    not:

    $( [ 'my-data' ] )
    

提交回复
热议问题