0
Using jQuery Framework in Code Playground
Ive tried calling the jQuery from a website <script type="javascript/text" src="https://code.jquery.com/jquery-3.1.1.js"></script> And I've tried calling the src=" *path to file on my desktop*" and neither of these allows my code to execute. Example <script type="javascript/text" src="https://code.jquery.com/jquery-3.1.1.js"></script> <script type="javascript/text"> function document_ready() { alert("Hello, jQuery!"); } $(document).ready(document_ready); </script>
2 Answers
+ 2
You forget to put this --> () after document_ready.
document_ready()
+ 1
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
</head>
<body>
<script>
function document_ready(){
alert("Hello, JQuery!");
}
$(document).ready(document_ready());
</script>
</body>
</html>