File: index.html

Recommend this page to a friend!
  Classes of Filipe Sá   jQuery AJAX Forms   index.html   Download  
File: index.html
Role: Example script
Content type: text/plain
Description: example html
Class: jQuery AJAX Forms
Make a form be submitted via AJAX using jQuery
Author: By
Last change: Update of index.html
Date: 3 years ago
Size: 1,015 bytes
 

Contents

Class file image Download
<html> <head> <title>Mariana Framework Ajax Form Snippet</title> </head> <body> <h2>Mariana Framework: <small>auto ajax submit form</small></h2> <form id="mariana-form" ajax="true" type="POST" success="callback(data)" complete="callback2(data)" action="ajax.php"> <input type="text" name="text-input-1" /><br> <input type="file" name="file-input-1" /><br> <button type="submit">Submit</button><br> </form> <div > <ul id="appendResults"> </ul> </div> <script src="http://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous"></script> <script src="js/marianaAjax.js"></script> <script> var callback = function(data){ $('#appendResults').html(''); $.each(data, function(i){ $('#appendResults').append(JSON.stringify(data[i])); }); }; var callback2 = function(data){ console.log('Second callback'); console.log(data); }; </script> </body> </html>