Skip to content

keithhackbarth/submitAsJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

submitAsJSON

Submits a HTML form as JSON

Created by Keith Hackbarth 2018 Based off idea by David Tomaschik https://systemoverlord.com/2016/08/24/posting-json-with-an-html-form.html

Example usage:

  $("form").submit(function(event) {
      event.preventDefault();
      submitAsJSON(this);
  });

Output is is the same action as the original form but with JSON data instead of form-urlencoded.

Worth noting that hack that enables this to function adds a dummy key value pair to JSON called trash

About

Submits a HTML form as JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published