Jquery ajax调用在Firefox中不起作用
好的,我有这个电话Jquery ajax调用在Firefox中不起作用,jquery,ajax,Jquery,Ajax,好的,我有这个电话 $('.updatecom .registercomplaint').click(function(){ updatecomplaints(); }); This calls the function updatecomplaints() function updatecomplaints() { var tno = $(".updatecom #tno").val(); var status = $(".updatecom #status").val(); if
$('.updatecom .registercomplaint').click(function(){
updatecomplaints();
});
This calls the function updatecomplaints()
function updatecomplaints()
{
var tno = $(".updatecom #tno").val();
var status = $(".updatecom #status").val();
if(status=='DONE')
{
$(".updatecom #con").val('');
}
var tname = $(".updatecom #tname").val();
var rg11 = $(".updatecom #crg11").val();
var rg06 = $(".updatecom #crg06").val();
var tvpins = $(".updatecom #tvpins").val();
var jointer = $(".updatecom #jointer").val();
var cquantity = $(".updatecom #conqty").val();
var nooftv = $(".updatecom #tvno").val();
var misc = $(".updatecom #misc").val();
var tcomments = $(".updatecom #tcomments").val();
var con = $(".updatecom #con").val();
//alert(tno+status+tname+rg11+rg06+tvpins+jointer+cquantity+nooftv+misc+tcomments+con);
$.ajax(
{
type: "POST",
url: "up_functions.php",
data: "ticket="+ tno +"& opt=upcom" +"& status="+ status +"& tname="+ tname +"& rg11="+ rg11 +"& rg06="+ rg06 +"& tvpins="+ tvpins +"& jointer="+ jointer +"& cquantity="+ cquantity +"& nooftv="+ nooftv +"& misc="+ misc +"& tcomments="+ tcomments +"& con="+ con,
success: function(response)
{
alert(response);
}
});
}
here is my up_functions.php
$tno = htmlspecialchars(trim($_REQUEST['ticket']));
$status = htmlspecialchars(trim($_REQUEST['status']));
$tname = htmlspecialchars(trim($_REQUEST['tname']));
$rg11 = htmlspecialchars(trim($_REQUEST['rg11']));
$rg06 = htmlspecialchars(trim($_REQUEST['rg06']));
$tvpins = htmlspecialchars(trim($_REQUEST['tvpins']));
$jointer = htmlspecialchars(trim($_REQUEST['jointer']));
$cquantity = htmlspecialchars(trim($_REQUEST['cquantity']));
$nooftv = htmlspecialchars(trim($_REQUEST['nooftv']));
$misc = htmlspecialchars(trim($_REQUEST['misc']));
$tcomments = htmlspecialchars(trim($_REQUEST['tcomments']));
$con = htmlspecialchars(trim($_REQUEST['con']));
$result=$ptr->upcomticketinfo($tno,$status,$tname,$rg11,$rg06,$tvpins,$jointer,$cquantity,$nooftv,$misc,$tcomments,$con);
echo $result;
and here is my upconticketinfo() php function
function upcomticketinfo($tno,$status,$tname,$rg11,$rg06,$tvpins,$jointer,$cquantity,$nooftv,$misc,$tcomments,$con)
{
if($con!='' || $con!=NULL)
{
$this->query = "update `booking discription` set `STATUS`='$status',`CLOSED ON`='$con' where `TICKET NO`='$tno'";
$this->q_result = mysql_query($this->query,$this->conn) or die(mysql_error());
if($this->q_result)
{
$query = "update `tech detail` set `TECH NAME`='$tname',`CABLE RG11`='$rg11',`CABLE RG06`='$rg06',`TV PINS USED`='$tvpins',`JOINTER USED`='$jointer',`CONNECTOR QTY`='$cquantity',`NO OF TV`='$nooftv',`MISC`='$misc',`TECH COMMENTS`='$tcomments' where `BOOKING`='$tno'";
$q_result = mysql_query($query,$this->conn) or die(mysql_error());
if($q_result)
{
$response = "updated";
}
else
{
$response = "error";
}
}
else
{
$response = "error";
}
}
else
{
$this->query = "update `booking discription` set `STATUS`='$status' where `TICKET NO`='$tno'";
$this->q_result = mysql_query($this->query,$this->conn) or die(mysql_error());
if($this->q_result)
{
$query = "update `tech detail` set `TECH NAME`='$tname',`CABLE RG11`='$rg11',`CABLE RG06`='$rg06',`TV PINS USED`='$tvpins',`JOINTER USED`='$jointer',`CONNECTOR QTY`='$cquantity',`NO OF TV`='$nooftv',`MISC`='$misc',`TECH COMMENTS`='$tcomments' where `BOOKING`='$tno'";
$q_result = mysql_query($query,$this->conn) or die(mysql_error());
if($q_result)
{
$response = "updated";
}
else
{
$response = "error";
}
}
else
{
$response = "error";
}
}
return $response;
}
问题是,这段代码在IE8中运行得很好,即我正在使用。。。但它在FF 3.6.3中不起作用。。。我已经检查了每件事。。。一件事是,只有当我使用firebug调试器调试页面时,代码才能在FF上正常工作。否则,ajax成功中的警报将显示为空白。。。帮帮我…你有你的符号,但有一个空格?因此,您正在发送&%20key=数据-请改用对象:
{ticket: tno, opt: 'upcom', status: status }
我相信这个。ie8和ff 3.6.3对查询字符串的编码方式可能有所不同。。。我也像这样试过。。。数据:{“ticket”:tno,“opt”:“upcom”,“status”:status,“tname”:tname,“rg11”:rg11,“rg06”:rg06,“tvpins”:tvpins,“jointer”:jointer,“cquantity”:cquantity,“nooftv”:nooftv,“misc”:misc,“tcomments”:tcomments,“con”:con},可能的副本