Strings logged in Firebug will have always double quotes around them. That
is how firebug tells the user the value is a string, and the only way to see
the difference between:
console.log(123)
and
console.log("123")If you want to be sure about the content of the string, use alert. Yeah, alert is old, but still useful in some cases :) By the way, browsers like Chrome don't wrap strings in quotes on the console output. Instead, numbers are displayed in blue and strings in black. On Sat, Apr 17, 2010 at 8:29 PM, Jacob <[email protected]> wrote: > I think i found my issue - even though im not even sure how this fixed > anything... > > var jsonSearchSettings = {'search' : query}; > jsonSearchSettings = JSON.encode(jsonSearchSettings); > console.log(jsonSearchSettings); > > worked like your example in jsFiddler, Sandy, but this > > var jsonSearchSettings = JSON.encode({'search' : query}); > console.log(jsonSearchSettings); > > output the double quoted string...i think i might just falling asleep > at the helm here, and need to step away from this code. > Im baffled. > > > On Apr 17, 11:09 pm, Jacob <[email protected]> wrote: > > Interesting, when I use your example with jsFiddle there are no > > wrapping quotes (which is good), but when I use Firebug directly to > > return JSON.encode({apple: 'red', lemon: 'yellow'} it comes wrapped in > > double quotes, which mirrors what im seeing on my server side code. > > > > I dont understand whats going on... > > > > On Apr 17, 10:59 pm, Sanford Whiteman <[email protected]> > > wrote: > > > > > > > > > > -- but instead in firebug I get this > > > > "{"apple":"red","lemon":"yellow"}" > > > > > Can you show this in a jsFiddle? > > > > > I see no such anomaly here > > > > > http://jsfiddle.net/Drm9F/ > > > > > and such a bug would be causing wide-ranging problem if it existed in > > > a basic environment. > > > > > It's surely something about the way you are reencoding the data before > > > putting it on the wire, not JSON.encode(). > > > > > -- Sandy > > > > > -- > > > Subscription settings: > http://groups.google.com/group/mootools-users/subscribe?hl=en >
