jQuery plug in ajaxFileUpload asynchronous file upload effect
- 2020-05-27 04:26:21
ajaxFileUpload is an jQuery plug-in that uploads files asynchronously.
Send 1 do not know what version of up, after need not look for everywhere.
Grammar: $. ajaxFileUpload ([options])
options parameter description:
1. Address of url upload handler.
2, fileElementId needs to upload the ID file domain, that is < input type="file" > ID.
3. Whether secureuri enables secure submission, false is the default.
4. Data type returned by dataType server. Is either a xml script json, html. If not, jQuery will automatically judge.
5. The processing function automatically executed after success successfully submits, and the parameter data is the data returned by the server.
6, error submits the handler that failed to execute automatically.
7, data custom parameters. This is useful when there is data related to uploaded images.
8, type when submitting a custom parameter, this parameter is set to post
1, SyntaxError: missing; before statement error
If this error occurs, you need to check if the url path is accessible
2, SyntaxError: syntax error error
If this error occurs, you need to check for syntax errors in the server background handler that handles the commit
3, SyntaxError: invalid property id error
If this error occurs, you need to check whether the text field property ID exists
4, SyntaxError: missing} in XML expression error
If this error occurs, you need to check whether the file name is 1 or does not exist
5. Other custom errors
You can use the variable $error to print directly to check whether the parameters are correct, which is much more convenient than the invalid error prompts above.
That's all for this article, I hope you enjoy it.