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 seas...@gmail.com wrote:
That's okay, javascript doesn't have associative arrays, only arrays
with object properties.
On Jun 22,
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
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
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,
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
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' ?
before someone complains: that function won't handle arrays (only
objects)
On Jun 22, 6:39 pm, Ricardo ricardob...@gmail.com 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
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 diogobae...@gmail.com wrote:
Hmmm... why would one use this plugin if we have Douglas Crockford's
json2.org, which is
That's okay, javascript doesn't have associative arrays, only arrays
with object properties.
On Jun 22, 2:45 pm, Ricardo ricardob...@gmail.com wrote:
before someone complains: that function won't handle arrays (only
objects)
On Jun 22, 6:39 pm, Ricardo ricardob...@gmail.com wrote:
Usually
are u looking for
http://www.google.co.in/search?q=jquery+json+plugin ?
10 matches
Mail list logo