Recently http://www.open-open.com/ajax/Upload.htm looking to borrow a lot of flash to select the file upload control on, based on the jQuery uploadify very fond of. So they brought applications to the project, but found a bug, either in the <form> tag used, will prompt a script error, looking for a long reason, found online there is a sticker saying in the IE browser, the flash object put the time between the tag form, js will be given ( http://www.cnitblog.com/flashlizi/archive/2007/09/10/33202.html ), thus modifying its method for use under uploadify
Use Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<title></title>
<link href="uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.uploadify.js"></script>
</head>
<body>
<form runat="server" id="form1">
<div>
<p>
<strong>Single File Upload</strong></p>
<input type="text" id="fileInput1" />
<br />
<a href="javascript:$('#fileInput1').fileUploadStart();">Upload Files</a>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#fileInput1').fileUpload({
'uploader': 'uploader.swf',
'script': 'Handler.ashx',
'cancelImg': 'cancel.png',
'folder': 'upload',
'onAllComplete': function() { alert('a'); }
});
});
</script>
</form>
</body>
</html>
Open the Web page is not the first time a script error, but the refresh will pop up an error message, you do not understand! Hope can pass under the guidance of a master
jquery.uploadify (v1.6.2 modified version)
Reproduced in: https: //www.cnblogs.com/hdjjun/archive/2009/03/19/1416692.html