I was able to find the root cause.  jQuery 1.4.1 does not consider javascript 
objects that contain functions to be be valid JSON.

This is ok: {"foo":"bar"}
This is bad: {"foo":function(){alert('hello')}

jquery-1.4.1.js:491 --> parseJSON

jquery 1.3.2 simply eval'd strings to created json objects, so there was no 
problem.  I think it's kind of nice to be able to return JSON objects via ajax 
calls with embedded functions, but please feel free to educate me if you think 
that's a bad idea.

I'll also try to get some feedback from the jQuery forum.

Thanks,

Jon

On Feb 3, 2010, at 2:21 PM, Jonathan Hoffman wrote:

> Hi,
> 
> There is a problem with making jsonCalls which return JSON with anonymous 
> functions.  I've created a very simple reproducible example, but have not 
> been able to track down the root cause.  
> 
> Take a look at jsonCallBug in: 
> http://github.com/hoffrocket/lift_1_1_sample/blob/master/src/main/scala/com/liftcode/snippet/Hello.scala
> 
> The project should run in mvn or sbt.
> 
> Thanks,
> 
> Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to