I'm using a PHP script that is waiting for two values through $_GET.
I'm trying to pass those 2 values using jQuery and that's where I'm not too good at.
Here's the code I've got.
Can somebody point me in the right direction ? Thanks !
function xrate(id,rating){
$.ajax({
url: "ajax_xrate.php?id="+id+"&rate="+rating,
global: false,
type: "GET",
dataType: "text",
async:false,
success: function(){
alert('Bravo!');
}
});
}
(actual code copied from the comments)
function xrate(id,rating){
var oDate = new Date();
$.ajaxSetup({ cache: false });
$.ajaxSetup({
scriptCharset: "utf-8" ,
contentType: "application/x-www-form-urlencoded; charset=UTF-8"
});
$.ajax({
url: 'ajax_xrate.php?timestamp='+oDate.getMilliseconds(),
dataType: 'html',
data: {itemid:id, keyrate:rating},
cache: false,
type: "GET",
success : function(dataReturn){
alert(dataReturn);
}
});
}