javascript - uncaught reference $ is not defined -


i trying project javascript using events on keys display alphabets on screen, i'm stuck error. please help

<!doctype html> <html lang="en">   <head>     <meta charset="utf-8">     <meta http-equiv="x-ua-compatible" content="ie=edge">     <meta name="viewport" content="width=device-width, initial-scale=1">     <title></title>      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">      <!--[if lt ie 9]>       <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.2/html5shiv.js"></script>       <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>     <![endif]-->   </head>   <body>  <script src="script.js" charset="utf-8"></script>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>   </body> </html>  script file i'm using 

script.js

(document).keydown(function(event) {   if (event.which === 13) {     console.log("you pressed");   } }); 

you're running script before jquery, $ doesn't exist yet.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -