I can't link my JQuery file to my HTML file

Top Lit

I can't seem to link my JQuery file to my HTML file no matter what I try. The JQuery code itself works when I put it in a script section on the HTML page but doesn't work from the file.

Heres the head for my HTML:

<!DOCTYPE html>
<!--Index page-->

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- CSS file link -->
    <link href="login-css.css" rel="stylesheet" type="text/css">
    <!-- JQuery link -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="js/jquery.js" type="text/javascript"></script>

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

and the bottom of the body:

    <!-- Bootstrap jQuery -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
  </body>
</html>

And here is the JQuery code :

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<script>
$(window).on('load', function () {
      alert("For this prototype please use admin as username and password as password");
 });

</script>
Atul Rajput
  1. You have called jquery cdn at two place, remove it from head.
  2. and just add your Jquery.js file below the Jquery cdn at bottom of your page, and see the magic.
  3. and no need to call Jquery cdn in your JS file, remove it from there too

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

how can i link an XML data file from my hard drive (not web) to my project?

分類Dev

When i put my html file online it doesn't recognise my png file

分類Dev

Why can't I open my txt file in Ubuntu?

分類Dev

can't run my own .desktop file

分類Dev

How can I fetch XML Data from a file stored on my PC and populate a table in HTML using javascript?

分類Dev

How can I find which file or code affected to my code in html, css

分類Dev

Would anyone please tell me what is wrong with my CSS file? When i call the primary color, it doesn't show in my html

分類Dev

Would anyone please tell me what is wrong with my CSS file? When i call the primary color, it doesn't show in my html

分類Dev

How would I conditionally interpolate a string in my HTML file with AngularJS?

分類Dev

Why is my systemd link file being ignored?

分類Dev

My bat file can't run correctly, why?

分類Dev

How can i create a custom ListView with my xml layout file?

分類Dev

How can I convert a string in my JSON file into a Ruby hash?

分類Dev

How can I create my own spelling file for vim?

分類Dev

How can I treat my disk like one big file?

分類Dev

How can I change the icon for a binary file on my desktop?

分類Dev

I can't use a JS script in my HTML with Vue js

分類Dev

How do I move from my html file to another html file to create an iOS hybrid app?

分類Dev

How do I move from my html file to another html file to create an iOS hybrid app?

分類Dev

How can I bundle my database file into my app, ready for a side load install?

分類Dev

How can i anchor points on my .docx template file to dump my variable strings?

分類Dev

What is wrong with this JavaScript in my html file?

分類Dev

Firefox can't handle my jQuery

分類Dev

How do I pass a blade variable to a vue instance so I can use it in my JavaScript file?

分類Dev

I can't update my contacts

分類Dev

I can't fill in the blanks in my code

分類Dev

I Can't Shake/Motion on my device

分類Dev

I can't change the value of my variable

分類Dev

Why do I link my jquery inside a document.write?

Related 関連記事

  1. 1

    how can i link an XML data file from my hard drive (not web) to my project?

  2. 2

    When i put my html file online it doesn't recognise my png file

  3. 3

    Why can't I open my txt file in Ubuntu?

  4. 4

    can't run my own .desktop file

  5. 5

    How can I fetch XML Data from a file stored on my PC and populate a table in HTML using javascript?

  6. 6

    How can I find which file or code affected to my code in html, css

  7. 7

    Would anyone please tell me what is wrong with my CSS file? When i call the primary color, it doesn't show in my html

  8. 8

    Would anyone please tell me what is wrong with my CSS file? When i call the primary color, it doesn't show in my html

  9. 9

    How would I conditionally interpolate a string in my HTML file with AngularJS?

  10. 10

    Why is my systemd link file being ignored?

  11. 11

    My bat file can't run correctly, why?

  12. 12

    How can i create a custom ListView with my xml layout file?

  13. 13

    How can I convert a string in my JSON file into a Ruby hash?

  14. 14

    How can I create my own spelling file for vim?

  15. 15

    How can I treat my disk like one big file?

  16. 16

    How can I change the icon for a binary file on my desktop?

  17. 17

    I can't use a JS script in my HTML with Vue js

  18. 18

    How do I move from my html file to another html file to create an iOS hybrid app?

  19. 19

    How do I move from my html file to another html file to create an iOS hybrid app?

  20. 20

    How can I bundle my database file into my app, ready for a side load install?

  21. 21

    How can i anchor points on my .docx template file to dump my variable strings?

  22. 22

    What is wrong with this JavaScript in my html file?

  23. 23

    Firefox can't handle my jQuery

  24. 24

    How do I pass a blade variable to a vue instance so I can use it in my JavaScript file?

  25. 25

    I can't update my contacts

  26. 26

    I can't fill in the blanks in my code

  27. 27

    I Can't Shake/Motion on my device

  28. 28

    I can't change the value of my variable

  29. 29

    Why do I link my jquery inside a document.write?

ホットタグ

アーカイブ