I have this jQuery:
$.post(document.URL, {'blanks':word});
$.post(document.URL, {'blanks':{ word :{'time':T}}});
And this is the result when I log it in terminal:
{ blanks: 'plotted' }
{ blanks: { word: { time: '1386984059685' } } }
Why does the variable word
not change in the second jQuery statement? I assume it has something to do with single quotes being added to the key name, but I couldn't figure a work around.
I solved my problem with
$.post(document.URL, {'blanks':{'word':word, 'time':T}});
which resulted in
{ blanks: { word: 'plotted', time: '1386984409890' } }
But I was curious as to why the variable didn't change when it was the key, and if there was a way to do it?