Okay I have this ajax call
我调用了ajax
$('.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;
}
Question is that, this code is working just fine in IE8 i.e i am using... but it is not working in FF 3.6.3... I have checked each n everything... One thing is that the code works fine on FF too only when i debug the page with firebug debugger. Otherwise the alert in ajax success shows itself with nothing in it... Help me...
问题是,这段代码在IE8中运行良好。e我用……但它在FF 3.6.3中不起作用……我检查了每n个东西……有一点是,只有在使用firebug调试器调试页面时,代码才能在FF上正常工作。否则,ajax成功的警报就会显示出来,其中什么也没有……帮我……
1 个解决方案
#1
3
you have your ampersands but then a space? so you're sending &%20key=data - use an object instead:
你有与号,但是有空格吗?因此,您正在发送&%20key=data—使用对象代替:
{ticket: tno, opt: 'upcom', status: status }
#1
3
you have your ampersands but then a space? so you're sending &%20key=data - use an object instead:
你有与号,但是有空格吗?因此,您正在发送&%20key=data—使用对象代替:
{ticket: tno, opt: 'upcom', status: status }