help porting from prototype to jquery - ajax.request
Hi,
Very new to JS let alone the various libraries... I am trying to port to Jquery but have got completely stuck!! Can anyone point me in the right direction? or specify a function I should use? I'm very interested in learning but there is just so much to take on that its a bit overwhelming...
My prototype code:
-
getServerTime : function(){
try{
var req = new Ajax.Request(NTP.serverUrl,{
onSuccess : NTP.parseServerResponse,
method : "get",
parameters : "t=" + NTP.getNow()
});
}
catch(e){
return false;
//prototype.js not available
}
},
This basically gets the result t from a small PHP appends NTP.getnow()
I need to achieve the same thing either by normal javascript or jquery..
heres where I got to qith jquery.. I know its a mess :/
-
getServerTime : function () {
$.ajax({
type: 'GET',
url: './gettime.php?t',
success: NTP.parseServerResponse,
data: 't=' + NTP.getNow (), }),
}
Can anyone help please? would be very much appreciated.. [/code]