我有像这样的PHP代码
//this have loop for repeat data by $i
<tr>
<th>Num:</th>
<th>upload</th>
</tr>
<tr>
<td><?php echo $i?></td>
<td>
<div id="me<?php echo $i ?>" num="<?php echo $i ?>" class="styleall me" ><span ><span class="glyphicon glyphicon-folder-open uploadChange"></span></span></div><span id="mestatus<?php echo $i ?>" class="mestatus" ></span>
<div id="files<?php echo $i ?>" class="files">
<li class="success">
</li>
</div>
</td>
</tr> // end loop
这是我的剧本
$('.uploadChange').click(function(event) {
event.preventDefault();
var num = $('.me').attr('num');
var btnUpload = $('#me'+num);
var mestatus = $('#mestatus' + num);
var files = $('.files');
new AjaxUpload(btnUpload, {
action: '/uploadDoc.php',
name: 'uploadfile',
onSubmit: function(file, ext) {
if (!(ext && /^(pdf)$/.test(ext))) {
mestatus.text('PDF files are allowed');
return false;
}
mestatus.html('<img src="/ajax-loader.gif" height="16" width="16">');
},
onComplete: function(file, response) {
mestatus.text('File Uploaded Sucessfully!');
files.html('');
}
});
});
这是this
后面的代码我的代码只能为数据的第一行元素上传和运行。 我的问题是,当我点击下一行元素时,它不是在块中执行:
new AjaxUpload(btnUpload, {
action: '/uploadDoc.php',
name: 'uploadfile',
onSubmit: function(file, ext) {
if (!(ext && /^(pdf)$/.test(ext))) {
mestatus.text('PDF files are allowed');
return false;
}
mestatus.html('<img src="/ajax-loader.gif" height="16" width="16">');
},
onComplete: function(file, response) {
mestatus.text('File Uploaded Sucessfully!');
files.html('');
}
});
请帮我复习一下,我的代码可以上传一个文件PDF所有行元素数据,谢谢。