[Gllug] OT: Anyone know Jquery & JSON ?

general_email at technicalbloke.com general_email at technicalbloke.com
Tue Nov 9 07:31:13 UTC 2010


I'm just learning the above in order to interface with a python app I'm 
writing and have run into something a little confusing... The GET 
requests generated by $.getJSON() don't simply tack raw JSON on the end 
of the URL, they appear as follows...

https://localhost:8888/ajax/?_=1289285615145&q=jamjar

Now I didn't really expect jQuery to just use raw JSON, but I did assume 
it would use something simple and fairly universal like standard HTTP 
URL encoding or base64 encoding to serialize the JSON so it would sit 
nicely within HTTPs URL format.

This doesn't seem to be the case though, the output is clearly not 
base64 and when I try running the result through python's 
urllib2.unquote( string ) function it comes out identical i.e. not 
decoded into JSON. I'm quite tired so I'm sure I'm missing something 
fairly simple here, could anyone clue me in as to what the encoding is 
being used here?

Cheers,

Roger.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list