Jquery - Linking external .js file not working

前端 未结 1 1806
一向
一向 2021-01-14 17:02

For some reason the external .js file I am linking to isn\'t working. I am linking to it like so:



        
相关标签:
1条回答
  • 2021-01-14 17:17

    Problem 1

    It looks like jquery.js contains the code you wrote that depends on jQuery.

    You need to load jQuery before you try to use it.

    Swap the order of the <script> elements.


    Problem 2

    $("document") will wait for <document> elements to be ready. HTML doesn't have such a thing. Lose the quotes to pass in the document object directly.

    Better yet, forget about the explicit call to ready and just

    jQuery(function () { /* your function */ });
    
    0 讨论(0)
提交回复
热议问题