2024年5月6日发(作者:)

// Call user-supplied (or default) onStart(), setting

// it's this context to the file DOM element

var ret = ($element, []);

// let onStart have the option to cancel the upload

if(ret !== false)

{

$('form').submit(function(e) { opagation(); }).submit();

} else {

uploading_file = false;

}

}

};

// Mark this element as setup

$('ajaxUploader-setup', true);

/*

// Internal handler that tries to parse the response

// and clean up after ourselves.

*/

var handleResponse = function(loadedFrame, element) {

var response, responseStr = $(loadedFrame).contents().text();

try {

//response = $.parseJSON($.trim(responseStr));

response = (responseStr);

} catch(e) {

response = responseStr;

}

// Tear-down the wrapper form

gs().remove();

();

uploading_file = false;

// Pass back to the user

(element, [response, ]);

};

/*

// Wraps element in a

tag, and inserts hidden inputs for each

// key:value pair in so they can be sent along with

// the upload. Then, creates an iframe that the whole thing is

// uploaded through.

*/

var wrapElement = function(element) {

// Create an iframe to submit through, using a semi-unique ID

var frame_id = 'ajaxUploader-iframe-' + (new Date().getTime() / 1000)

$('body').after('