I am facing problem in passing parrameters with ajax url.I think error is in parametters code syntax.Plz help.
var timestamp = null;
function waitformsg(id,name) {
$.ajax({
type:"Post",
url:"getdata.php?timestamp="+timestamp+"uid="+id+"uname="+name,
async:true,
cache:false,
success:function(data) {
});
}
I am accessing these parameters as follows
<?php
$uid =$_GET['uid'];
?>
why not just pass an data an object with your key/value pairs then you don't have to worry about encoding
$.ajax({
type: "Post",
url: "getdata.php",
data:{
timestamp: timestamp,
uid: id,
uname: name
},
async: true,
cache: false,
success: function(data) {
};
}?);?
Source: Stackoverflow.com