On 3 Mar, 02:24, "yoshi" <[EMAIL PROTECTED]> wrote:
> by auto eval(), when content type is 'text/javascript', do u mean i
> dont need to define 'onSuccess: blah blah'?
> so assuming i change the content type of the response header, ( i
> checked the response header in firebug ) and my ajax.request code
> looks like
>
> new Ajax.Request(src, { method:'get'} );
>
> no callback function defined? it didnt work............

It should.
Check if JS code returned is correct.

Maybe OT but for example, I had such a problem today (that's why i
read this list now):
I was returning JS code like that
{
  //some object properties using JSON
}
And added onExeption callback in Ajax.Request construtor parameters.
The JSON code returned wasn't correct for Firefox (throwed an
exception) - it expected the block of expressions (surrounded with
curly braces {}) and in fact it was an object in JS object notation
(surrounded with curly braces too). Surrounding (adding not replacing
ofc) all the Ajax response code in ordinary braces () has solved the
problem.
Of course to get the JSON value I had to eval() it again, because
inner mechanism doesn't save nowhere/return no way the result of
eval()'s :-(


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to