Uncaught ReferenceError: $ is not defined
at index.html:4
If you see the $ is not defined error in your HTML code, the reason is you have defined the jQuery library import script after using the $ (dollar function), make sure you add <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> before you use jQuery function,
Below Example will through console error,
<html>
<head>
<script>
$(document).ready(function () {
console.log("hello this is some code!");
});
</script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<H1>$ is not defined</H1>
</body>
</html>
Error: Uncaught ReferenceError $ is not define
Code After fixing the issue:
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function () {
console.log("hello this is some code!");
});
</script>
</head>
<body>
<H1>$ is not defined error fixed! </H1>
</body>
</html>
More Posts related to jQuery,
More Posts:
- Android Emulator] ##KBD: Full queue, lose event Error Logs - Android
- PHP drag and drop file upload tutorial using dropzone.js - PHP
- Column Mode Editing in Notepad++ - NotepadPlusPlus
- Gmail Unable to upload because it is a folder or a package (like an application bundle or RTFD document) - HowTos
- Android Shared Preferences API tutorial - Android
- Notepad++ Dark Theme - NotepadPlusPlus
- Change Mouse Scrolling in Mac OS X - Mac-OS-X
- Android Studio java.net.NoRouteToHostException - Android-Studio
- Error : Invalid key hash.The key hash does not match any stored key hashes - Android
- JSON Schema and Hyper-Schema : JSON Tutorial - Json-Tutorial
- 'Edit Document' Requires a Windows Sharepoint Services-compatible application and Microsoft Internet Explorer 6.0 or higher - SharePoint
- Remove Trailing zeros BigDecimal Java - Java
- Android Studio : Connection Error : Failed to download patch file - Android-Studio
- Find Java JRE Installation location Mac OS X - Mac-OS-X
- Go to Line Number option in Windows Notepad - NotepadPlusPlus