user2198154
user2198154

Reputation: 41

error file uploading using blueimp

I am trying to upload file by blueimp file upload.I use very simple code for testing but the code is not working.In firefox error console there is two error

Here is my code

<input id="fileupload" type="file" name="picture"/>
<input type='button' id='sub'/>


$('#sub').click(function () {
$('#fileupload').fileupload({
    url: 'php/index.php',
   // dataType: 'json',
    done: function (e, data) {
        $.each(data.result.files, function (index, file) {
            $('<p/>').text(file.name).appendTo(document.body);
        });
    }
});
});

And after clicking button another error has occured

Upvotes: 4

Views: 2395

Answers (2)

Peter Morris
Peter Morris

Reputation: 23264

Press F12 in your browser and look at the network tab to see which scripts are being loaded when you refresh your page. In my case I had jquery being loaded twice, removing one of them fixed the problem for me.

Upvotes: 1

neminem
neminem

Reputation: 2698

So I'm pretty new to jquery, but I just got the same errors trying to use the same plugin. Looked up ajaxTransport and discovered it was a function actually in jquery, which gave me a pretty good guess that I was using an old version of jquery. Sure enough: VS2010 doesn't update its jquery, so if you create a new project in VS, you get jquery-1.4.1. jquery is up to version 1.10.0 now. Updated my project to that version, the errors went away and my server-side code was called successfully.

Upvotes: 1

Related Questions