[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

[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.

[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 (syntactically)

[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 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: {message:[