用jquery发送ajax请求报:TypeError: $.ajax is not a function错误!!!
<scripttype="text/javascript">varscore,scoreBussiness,scoreLogistics;functionreview()...
<script type="text/javascript">
var score, scoreBussiness, scoreLogistics;
function review(){
var grade;
var radios = document.getElementsByName("grade");
for(var i=0; i<radios.length; i++){
if(radios[i].checked==true){
grade = radios[i].value;
break;
}
}
var content = document.getElementById("content").value;
$.ajax({
url:"${base}/p2pUser/p2p_review/reviewProduct.jhtml",
type:"POST",
data:{
"p2pProductId": ${p2pProductId},
"grade": grade,
"score": score,
"scoreBussiness": scoreBussiness,
"scoreLogistics": scoreLogistics,
"content": content
},
dataType:"json",
cache:false,
success:function(message){
if (message.type == "success" && window.XMLHttpRequest) {
//$("#light").css("display","block").html(message.content);
//window.setTimeout("closewin()",1000);
alert(message.content);
}else{
alert(message.content);
}
}
});
}
</script>
引进jquery的路径是是真确的,可是所有用到jquery的地方都会报TypeError:这个错误!我要用juqery发送一个ajax请求,但是却报TypeError: $.ajax is not a function这个错误 展开
var score, scoreBussiness, scoreLogistics;
function review(){
var grade;
var radios = document.getElementsByName("grade");
for(var i=0; i<radios.length; i++){
if(radios[i].checked==true){
grade = radios[i].value;
break;
}
}
var content = document.getElementById("content").value;
$.ajax({
url:"${base}/p2pUser/p2p_review/reviewProduct.jhtml",
type:"POST",
data:{
"p2pProductId": ${p2pProductId},
"grade": grade,
"score": score,
"scoreBussiness": scoreBussiness,
"scoreLogistics": scoreLogistics,
"content": content
},
dataType:"json",
cache:false,
success:function(message){
if (message.type == "success" && window.XMLHttpRequest) {
//$("#light").css("display","block").html(message.content);
//window.setTimeout("closewin()",1000);
alert(message.content);
}else{
alert(message.content);
}
}
});
}
</script>
引进jquery的路径是是真确的,可是所有用到jquery的地方都会报TypeError:这个错误!我要用juqery发送一个ajax请求,但是却报TypeError: $.ajax is not a function这个错误 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询