I'm trying to execute a JavaScript function. I get an error everytime the function enters the Ajax block saying:
$ is not defined
How can I solve this problem? I'm Programming a Google Chrome Addon
and I get this error in my .js file:
At the moment ther is just the function above and its caller in the file:
// Calls get_pw function
document.addEventListener('DOMContentLoaded', function(){
document.getElementById('submit').addEventListener('click', get_pw)
})
Many Thanks
Download jQuery from https://code.jquery.com/jquery-3.3.1.min.js . Include it in head tag of your document and call get_pw() when document has loaded.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.