Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fengyuanchen/submitter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fengyuanchen/submitter

A simple jQuery form submitting plugin.

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Submitter

A simple jQuery form submitting plugin.

  • Demo

Main

dist/
├── submitter.js      (7 KB)
└── submitter.min.js  (4 KB)

Getting started

Quick start

Three quick start options are available:

  • Download the latest release.
  • Clone the repository: git clone https://github.com/fengyuanchen/submitter.git.
  • Install with NPM: npm install @fengyuanchen/submitter.

Installation

Include files:

<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<script src="/path/to/submitter.js"></script>

Usage

Initialize with $.fn.submitter method.

$('form').submitter({
  done: function (e, data) {
    console.log(e.type); // 'done'
    console.log(e.namespace); // 'submitter'
    console.log(data); // Response data
  }
});

Options

// Set submitter options
$().submitter(options);

// Change the global default options
$.fn.submitter.setDefaults(options);

Note: jQuery.ajax's options are available too.

url

  • Type: String
  • Default: The form's "action" property

A string containing the URL to which the request is sent.

method

  • Type: String
  • Default: The form's "method" property

The HTTP method to use for the request (e.g. "POST", "GET").

start(event)

  • Type: Function
  • Default: null

A shortcut of the "start.submitter" event.

done(event, data, textStatus)

  • Type: Function
  • Default: null

A shortcut of the "start.submitter" event.

fail(event, textStatus, errorThrown)

  • Type: Function
  • Default: null

A shortcut of the "start.submitter" event.

end(event, textStatus)

  • Type: Function
  • Default: null

A shortcut of the "start.submitter" event.

Methods

destroy()

Destroy the submitter.

$().submitter('destroy');

Events

start.submitter

This event fires when the form is starting to submit.

done.submitter

This event is fired when the submit request succeeds.

fail.submitter

This event is fired when the submit request fails.

end.submitter

This event is fired when the submit request finishes (after done and fail events are fired).

No conflict

If you have to use other plugin with the same namespace, just call the $.fn.submitter.noConflict method to revert to it.

<script src="other-plugin.js"></script>
<script src="submitter.js"></script>
<script>
  $.fn.submitter.noConflict();
  // Code that uses other plugin's "$().submitter" can follow here.
</script>

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Opera (latest)
  • Edge (latest)
  • Internet Explorer 8+

As a jQuery plugin, you also need to see the jQuery Browser Support.

Versioning

Maintained under the Semantic Versioning guidelines.

License

MIT © Fengyuan Chen

Keywords

FAQs

Package last updated on 31 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc