Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

upload multiple image using jquery

$('body').on('click', '#upload', function(e){
        e.preventDefault();
        var formData = new FormData($(this).parents('form')[0]);

        $.ajax({
            url: 'upload.php',
            type: 'POST',
            xhr: function() {
                var myXhr = $.ajaxSettings.xhr();
                return myXhr;
            },
            success: function (data) {
                alert("Data Uploaded: "+data);
            },
            data: formData,
            cache: false,
            contentType: false,
            processData: false
        });
        return false;
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: vuejs enter phone with country flag 
Javascript :: #{} js 
Javascript :: dates in javascript 
Javascript :: jquery add url parameter to link dynamically by class 
Javascript :: camel case first javascript 
Javascript :: blob to pdf javascript 
Javascript :: graphql buildschema 
Javascript :: how to use two text fields in one single row react js 
Javascript :: axios post query params 
Javascript :: access text inside a button from js 
Javascript :: react native shadow maker 
Javascript :: sequelize include stop returning the join table 
Javascript :: node js simple server 
Javascript :: app running in expo client is slow 
Javascript :: get search value from reacr route1 
Javascript :: jest mock jwt-decode 
Javascript :: set time slots with date in javascript 
Javascript :: Object.create Polyfill 
Javascript :: for each loop in javascript 
Javascript :: how to download an mp3 file in react native 
Javascript :: javascript type checking 
Javascript :: run code in javascript 
Javascript :: javascript variables 
Javascript :: make input bigger if text does not fit 
Javascript :: check if array does not contain string js 
Javascript :: react document viewer 
Javascript :: react-multi-carousel equal spacing issue 
Javascript :: environment variable to debug knex 
Javascript :: how to get 6 months after date object 
Javascript :: localhost server in react native 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =