具有使用jQuery阿賈克斯 我要上傳使用ajax.But碼的follwing行的文件從server.M越來越resposnse問題M的工作不 第1頁:響應的錯誤
<script language="javascript" src="jquery-1.7.1.js"/></script>
<script language="javascript" src="jquery.form.js"/></script>
<script language="javascript">
$(document).ready(function(){
$('#photoimg').change(function(){
var fd=new FormData();
$.ajax({
type:'POST',
url:'NewuploadScript.php',
data:fd,
contentType: 'application/x-www-form-urlencoded',
async:true,
cache:false,
processData: true,
success:function Result(data2) {
document.write(data2);
}
});
});
});
</script>
<form>
<input type="file" id="photoimg" name="file" multiple>
<input type="submit" id="BtnSbmt" value="Upload"/>
</form>
PAG2:
<?php
echo $name= basename($_FILES['photoimg']['name']);
echo $size= basename($_FILES['photoimg']['size']);
?>
當我運行代碼的jquery顯示以下錯誤:
Uncaught TypeError: Illegal invocation
jQuery.extend.param.addjquery-1.7.1.js:7601
buildParamsjquery-1.7.1.js:7658
jQuery.extend.paramjquery-1.7.1.js:7621
jQuery.extend.ajaxjquery-1.7.1.js:7467
(anonymous function)ImageUploader.php:18
jQuery.event.dispatchjquery-1.7.1.js:3256
jQuery.event.add.elemData.handle.eventHandlejquery-1.7.1.js:2875
請訪問http:// stackoverflow.com/questions/9048358/illegal-invocation-error-in-ajax-jquery-1-7-1 – dotoree 2012-03-27 10:25:09
@dotoree它的否工作.... – kishor 2012-03-27 10:34:59
你得到它的工作.. http://stackoverflow.com/questions/5140156/illegal-operation-on-wrappednative-prototype-object – 2012-11-20 11:47:57