Date Added: 14/01/2015

  1. .is()
  2. .has()
  3. $.extend(obeject1, obeject2, obejectN );
  4. <script>$("td:gt(4)").css("text-decoration", "line-through");</script>
  5. .delegate()
  6. .clone() 
ajax form plugin  http://www.alajax.com/,
<pre>/**
 * ALAJAX auto sender for jQuery
 * Create an auto ajax sender from your basic HTML code.
 * @url http://www.alajax.com/
 * @version 1.2
 * CopyRight: GNU General Public License v2
 *
 * Developed by: Alaa Badran
 * http://www.alajax.com/
 * Email info@alajax.com
 *
 */
$ = jQuery; // Make sure its defined
<!--more-->
$.fn.alajax = function (options){
    // sgObj is a holder for #gallery container.. Cashing it.
    var aObj = $(this); // contaciner object
    var aForm = ($(this).is('form') ? $(this):$(this).find('form').eq(0)); // Storing Form object
    var oid = $(this).attr('id'); // Storing the ID of current Object

    // Default settings.
    var settings = {
        type: 'text',   // 'text', 'json' or 'xml'
        success: function(){},
        error: function (){},
        beforeSend: function (){},
        postType: aForm.attr('method'), // Storing Form method.. POST or GET
        tourl: aForm.attr('action') // Storing URL to send data to
    };
    settings = $.extend(settings, options);

    function _sendData(){
        // Run AJAX function
        $.ajax({
            type: settings.postType,
            url: settings.tourl,
            data: aForm.serialize(),
            dataType: settings.type,
            beforeSend: function (){
                // add code here if you want to do something before sending the form
                settings.beforeSend();
            },
            success: function(data, textStatus, jqXHR){
                // Add code here when send is successful.
                settings.success(data);
            },
            error: function (jqXHR, textStatus, errorThrown){
                //alert(errorThrown);
                settings.error();
            }

        });
    }

    /**
     * The initializer for this plugin.
     */
    function _init(){
        aForm.submit(function (event){
            _sendData(); // Processing
            event.preventDefault(); // To disable form submitting. Submit will be by AJAX only using the function above.
        });
    }

    return _init();
}
// END of Plugin</pre>

Last Update: Posted by: müslüm ÇEN
Not Commented Yet !
Please login in order to comment . Login