jquery-form/form

.selector property is removed

Open

#353 aperta il 26 ago 2013

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)JavaScript (2199 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (5209 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

http://jquery.com/upgrade-guide/1.9/#selector-property-on-jquery-objects

As of 1.9, the .selector property is gone. Looks like it is still hanging around in in ajaxForm. Unless I am reading this wrong, .selector needs to be dealt with.

$.fn.ajaxForm = function(options) { options = options || {}; options.delegation = options.delegation && $.isFunction($.fn.on);

// in jQuery 1.3+ we can fix mistakes with the ready state
if (!options.delegation && this.length === 0) {
    var o = { s: this.selector, c: this.context };
    if (!$.isReady && o.s) {
        log('DOM not ready, queuing ajaxForm');
        $(function() {
            $(o.s,o.c).ajaxForm(options);
        });
        return this;
    }
    // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
    log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
    return this;
}

if ( options.delegation ) {
    $(document)
        .off('submit.form-plugin', this.selector, doAjaxSubmit)
        .off('click.form-plugin', this.selector, captureSubmittingElement)
        .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
        .on('click.form-plugin', this.selector, options, captureSubmittingElement);
    return this;
}

return this.ajaxFormUnbind()
    .bind('submit.form-plugin', options, doAjaxSubmit)
    .bind('click.form-plugin', options, captureSubmittingElement);

};

Guida contributor