4

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

  • Error: TypeError: $.ajaxTransport is not a function

  • Error: TypeError: $.support is undefined

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

  • Error: TypeError: $(...).fileupload is not a function

    That means the plugins function is not working.please help.thanks in advance.

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

1 Comment

This happened with me. I was referring to VSS.SDK.min.js which already refers to Jquery. Removing an additional <script src ="<jquerycdnpath>"> solved the issue. Both the Jquery versions were different. But not sure if that (importing different versions) was the cause of the issue or just including multiple time (irrespective of the version of jquery)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.