Sending JSON to the server adds a layer of complexity to both sides.
If it has no benefits (I don't see any), then yes, you're better off
keeping it simple and using a query string and $_POST instead. jQuery
handles object to query string conversion automatically:
$.post('cheese.php', { cat: 1, m
Well, right now I am sending JSON to my php script which then uses
json_decode() to make them into vars. But, I am wondering, is sending
JSON the best way? Or should I just send the data as a normal query
string, rather than JSON? Which is best?
On Jun 22, 5:13 pm, cs wrote:
> Why not make ea
Why not make each field that has a nested key-value pair an object
instead? In short, any array with a key but without a value is an
object since your value is just an array of elements. What language is
in charge of your back-end? And how is it handling the inputs your
pass it? This is what reall
I know, I meant it won't handle actual arrays like [1,2,3]. Wasn't
needed at the time, probably not too difficult to implement.
On Jun 22, 9:24 pm, Josh Powell wrote:
> That's okay, javascript doesn't have associative arrays, only arrays
> with object properties.
>
> On Jun 22, 2:45 pm, Ricardo
That's okay, javascript doesn't have associative arrays, only arrays
with object properties.
On Jun 22, 2:45 pm, Ricardo wrote:
> before someone complains: that function won't handle arrays (only
> objects)
>
> On Jun 22, 6:39 pm, Ricardo wrote:
>
> > Usually you'll send out parameters in query
Yeah, I am not too hot on using a plugin for this. I had hoped there
was just a quick function that I could pass in an array and return
JSON.
On Jun 22, 8:28 am, diogobaeder wrote:
> Hmmm... why would one use this plugin if we have Douglas Crockford's
> json2.org, which is the original JSON lib
before someone complains: that function won't handle arrays (only
objects)
On Jun 22, 6:39 pm, Ricardo wrote:
> Usually you'll send out parameters in query strings, only receive data
> in JSON, which is what jQuery is equipped to do. If you don't want the
> weight of a plugin you could use somet
Usually you'll send out parameters in query strings, only receive data
in JSON, which is what jQuery is equipped to do. If you don't want the
weight of a plugin you could use something like this:
function toJSON(obj){
var json = '({';
$.each(obj, function(k,v){
var q = typeof v == 'string' ?
Hmmm... why would one use this plugin if we have Douglas Crockford's
json2.org, which is the original JSON library from the same creator of
the concept "JSON"? And why load more modules into the main jQuery
object, making it heavier, if we don't use DOM element wrappers in the
plugin, only convers
are u looking for
http://www.google.co.in/search?q=jquery+json+plugin ?
10 matches
Mail list logo