[jQuery] Re: JSON MIME type?

2007-08-23 Thread Stephan Beal

On Aug 23, 5:33 pm, Michael Randolph [EMAIL PROTECTED] wrote:
 I'm using the jQuery Form plugin to call an ASP.NET 2.0 page.  The call
 works just fine, but the response never comes back right.  If the
 Response.ContentType is set to text/plain the page gets forwarded to a
 plain text JSON result.

json is in fact plain text. It is only turned into an Object by
passing that text to eval(). Once you get the response text, simply
do: eval(responseText).



[jQuery] Re: JSON MIME type?

2007-08-23 Thread Yehuda Katz
Actually:

http://www.ietf.org/rfc/rfc4627.txt

On 8/23/07, Stephan Beal [EMAIL PROTECTED] wrote:


 On Aug 23, 5:33 pm, Michael Randolph [EMAIL PROTECTED] wrote:
  I'm using the jQuery Form plugin to call an ASP.NET 2.0 page.  The call
  works just fine, but the response never comes back right.  If the
  Response.ContentType is set to text/plain the page gets forwarded to a
  plain text JSON result.

 json is in fact plain text. It is only turned into an Object by
 passing that text to eval(). Once you get the response text, simply
 do: eval(responseText).




-- 
Yehuda Katz
Web Developer | Procore Technologies
(ph)  718.877.1325


[jQuery] AW: [jQuery] Re: JSON MIME type?

2007-08-23 Thread Roger Ineichen

Hi Stephan, Yehuda

 -Ursprüngliche Nachricht-
 Von: jquery-en@googlegroups.com 
 [mailto:[EMAIL PROTECTED] Im Auftrag von Stephan Beal
 Gesendet: Donnerstag, 23. August 2007 17:47
 An: jQuery (English)
 Betreff: [jQuery] Re: JSON MIME type?
 
 
 On Aug 23, 5:33 pm, Michael Randolph [EMAIL PROTECTED] wrote:
  I'm using the jQuery Form plugin to call an ASP.NET 2.0 page.  The 
  call works just fine, but the response never comes back 
 right.  If the 
  Response.ContentType is set to text/plain the page gets 
 forwarded to 
  a plain text JSON result.
 
 json is in fact plain text. It is only turned into an Object 
 by passing that text to eval(). Once you get the response text, simply
 do: eval(responseText).

Mime types are not only describing the content format which get sent,
they describe more, e.g. the application which should get used.

Web servers need this information for act as needed. We at 
Zope 3 implemented request factories using the Twisted server 
which get used if a relevant Mime type get sent from a client. 

This means JSON calls from the JQuery lib to a Zope 3 server 
will fail because of the bad JSON mime type set in JQuery.

Is there a way to change the existing text/plain to the 
recommended application/json for JSON calls?

Michael,
Probably you can use the json client lib I've implemented
for Zope3 supporting application/json.

svn://svn.zope.org/repos/main/jquery.javascript/trunk/src/jquery/javascript/
js


Regards
Roger Ineichen
_
END OF MESSAGE