Tag: jQuery

Simple jQuery AJAX and PHP Form Example

Here’s a simple 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, which will then output a response for AJAX. 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()…

Continue reading Simple jQuery AJAX and PHP 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