form.js 551 B

1234567891011121314151617181920
  1. ( function( factory ) {
  2. if ( typeof define === "function" && define.amd ) {
  3. // AMD. Register as an anonymous module.
  4. define( [ "jquery", "./version" ], factory );
  5. } else {
  6. // Browser globals
  7. factory( jQuery );
  8. }
  9. } ( function( $ ) {
  10. // Support: IE8 Only
  11. // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
  12. // with a string, so we need to find the proper form.
  13. return $.fn.form = function() {
  14. return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
  15. };
  16. } ) );