ajaxfileupload.js-Uncaught TypeError: jQuery.handleError is not a function

ajaxfileupload.js-Uncaught TypeError: jQuery.handleError is not a function


keeps getting error and cannot execute the specified success method.
By tracing the execution process of ajaxFileUpload , it is found that when calling its own uploadHttpData function, when executing if(type=="json") eval("data = "+data); status = "error" so the error method is always executed.
I checked the Internet and learned that the eval function is used to execute a piece of js code, not to reverse the json string as I thought.
eval("data = "+data); means to assign data to the data parameter, but when I When a simple string, such as "OK", is returned to the page, an exception is thrown when written in this way. Finally, it is changed to eval("data = \" "+data+" \" "); the data to be returned is enclosed in double quotes as a string, and then assigned to data. It finally worked. . .


The simple way is to return a simple string such as "1" for success, "0" for failure, and then to judge whether it is success or failure on the page

Modify the
if ( type == "json" ) in ajaxfileupload.js to

if ( type == "json" )
        {
        data=data.replace(/<[^>]+>/g,

        eval( "data =" + data);
        }

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326784777&siteId=291194637