I have a javascript (.js) file, and I'm trying to use it to call a php script. All the php script does is log something to a database. I want the javascript to run a certain function, and when it does, it will prompt the php script to run and log something to the database.
A lot of online sources have told me to use jQuery for this, though I'm a little confused. Isn't jQuery specifically attached to HTML DOMs? I just want the php file to log whenever a specific javascript.
I did trying using ajax for this, and here's my code: var urlRequest = $.ajax({ method: "GET", url: "php/logging.php", dataType: "script" }); However, I'm getting a very strange Uncaught ReferenceError: $ is not defined at HTMLLIElement.readyClicked (lobby.js:192)