Tag: jQuery

jQuery AJAX form example

Here’s a working example of an AJAX form using jQuery. Just create a new file my_form.html and paste in the code below. This AJAX form sends a request to form.php. my_form.html <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery AJAX form example</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript"> $(function() { // Variable to hold request var request;…

Continue reading jQuery AJAX form example

jQuery document ready shorthand

Below is the shorthand for $(document).ready() $(function() { console.log( “ready!” ); }); If you receive an error in console Uncaught TypeError: $ is not a function, noConflict() is probably enabled. Try this instead. jQuery(function() { console.log( “ready!” ); }); Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In…

Continue reading jQuery document ready shorthand