[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-29 Thread uncleroxk
Hi all, here is my latest code, still doesnt work with ie, but it is cleaner and neater now, before i continue, i would like to thanks those who have try to help me.. =D A variable call "last" is use to track the latest post id, so that i could use it to query the database and retrieve messages a

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread uncleroxk
Hi Matt, I have remove the trailing comma from the Json already, but it is still the same.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to pr

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread Matt Foster
There is a trailing comma in your object that IE doesn't like, considering a syntax error. Remember when evaling something that the expression you're evaluating has to have perfect syntax as well. On Sep 28, 12:39 pm, uncleroxk <[EMAIL PROTECTED]> wrote: > ok my JSON: > > {"messages": {"messag

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread uncleroxk
On Sep 29, 12:22 am, kangax <[EMAIL PROTECTED]> wrote: > On Sep 28, 11:10 am, uncleroxk <[EMAIL PROTECTED]> wrote: > > > > > I have try to change it to "var response = eval(request.responseJSON); > > ".. and add "header("Content-type: application/json");" on my php page > > that generate the Jso

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread uncleroxk
ok my JSON: {"messages": {"message":[ {"id": "75", "user": "name", "text": "message", "time": "Sun, 28 Sep, 08:19 PM" },]}} ---

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread kangax
On Sep 28, 11:10 am, uncleroxk <[EMAIL PROTECTED]> wrote: > I have try to change it to "var response = eval(request.responseJSON); > ".. and add "header("Content-type: application/json");" on my php page > that generate the Json.. but it is still not working... > > here is my updated version.. >

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread T.J. Crowder
Hi, You don't have to eval the responseJSON. The point of the responseJSON property is that the JSON has already been decoded into an object for you. So if you have page returning: { "foo": "bar" } and your handler looks like this function oncomplete(response) {

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread uncleroxk
I have try to change it to "var response = eval(request.responseJSON); ".. and add "header("Content-type: application/json");" on my php page that generate the Json.. but it is still not working... here is my updated version.. -

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread kangax
On Sep 28, 10:00 am, Blaze <[EMAIL PROTECTED]> wrote: > Hello, > > indeed something wrong here: > var response = eval("(" + request.responseText + ")"); > > You should just use: > var response = eval(request.responseText); Not really. Those parenthesis around a to-be-evaluated string make it (syn

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread Blaze
Hello, indeed something wrong here: var response = eval("(" + request.responseText + ")"); You should just use: var response = eval(request.responseText); Also I hope that you have right response for that 'for loop' to work. Cheers On Sep 28, 2:21 pm, uncleroxk <[EMAIL PROTECTED]> wrote: > Hi

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread T.J. Crowder
Hi, Why not use the responseJSON property? http://www.prototypejs.org/api/ajax/response Also: > //callback function > function loadcomplete(request) Your variable name there is probably misleading, as the callback receives an Ajax.Response object, not the Ajax.Request object. HTH, -- T.J. Cro

[Proto-Scripty] Re: problem with myajax oncomplete callback function

2008-09-28 Thread uncleroxk
Edit.. i mean i debug with the Alert function in IE... with firebug on firefox is fine.. Alert shows up well in firefox too, but not in IE --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us"