Uncaught TypeError: Object # has no method 'addPanel'

前端 未结 3 831
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 12:10

I am trying to implement an almost cross-browser bookmark functionality and found this on SO: How do I add an "Add to Favorites" button or link on my website?

3条回答
  •  失恋的感觉
    2020-12-21 12:22

    You should use wp_enqueue_script (Documentation)

    Your dependencies may not being called before that script. If you enqueue the script you can make the dependencies load first using

    wp_enqueue_script( $handle, $path to file, array( jquery ));`
    

    Since I placed jQuery in the array it will now load jQuery before the script.

提交回复
热议问题