Home > Web Front-end > JS Tutorial > Method to add additional parameters to jquery's ajaxfileupload_jquery

Method to add additional parameters to jquery's ajaxfileupload_jquery

WBOY
Release: 2016-05-16 16:57:18
Original
1194 people have browsed it

How to say it directly:

Copy code The code is as follows:

$.ajaxFileUpload({
data:{" a":123,"b":456};//Additional parameters, json format
});


Then modify the two functions in the ajaxFileUpload.js file. In fact, It’s just a function (add new parameters to the function)

First place:

Copy code The code is as follows:

createUploadForm: function(id , fileElementId,data){} is greater than line 26.

Then add the following code to the function body:

Copy the code The code is as follows:

if (data) {
for (var i in data) {
$(' }
}

Code function: Process json data and add input of type='hidden' to the form

Second place:

Copy code The code is as follows:

ajaxFileUpload(){}
var form = jQuery.createUploadForm(id, s.fileElementId,s.data); Just modify this line, just add one more parameter.

The modification here is actually about the parameters of the function call.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template