Weedpacket;11027531 wrote:Of more help would be an example of the JSON. All any of that tells is is that you're making a lot of requests for things (mostly from CDNs) that haven't changed since the last time you requested them (except for the one that is sending back JSON data).
It's not the responsibility of http headers to modify the content of the response.
So the extra bracket is there when the header is not present and the extra bracket is there when the header is present. Maybe it's not the header that's the problem.
Well I do have the right json datatype in the AJAX. Below is the top of the jquery AJAX call. When I take out the line of the contentType it takes out the brackets but it leaves the word Object. When I leave the contentType in, I have the brackets.
.ajax({
url: 'form_handler1.php',
contentType:"application/json; charset=utf-8",
dataType : "json",
[{"todo":"","date":"0000-00-00","name":"","id":"609"},{"todo":"","date":"0000-00-00","name":"","id":"608"},{"todo":"","date":"0000-00-00","name":"","id":"607"},{"todo":"ddd","date":"0000-00-00","name":"","id":"606"},{"todo":"ddd","date":"0000-00-00","name":"","id":"605"},{"todo":"ddd","date":"0000-00-00","name":"","id":"604"},{"todo":"","date":"0000-00-00","name":"","id":"603"},{"todo":"","date":"0000-00-00","name":"","id":"602"},{"todo":"","date":"0000-00-00","name":"","id":"601"},{"todo":"laundry","date":"0000-00-00","name":"janis rough","id":"600"},{"todo":"janis rough","date":"0000-00-00","name":"","id":"640"},{"todo":"janis rough","date":"0000-00-00","name":"","id":"639"},{"todo":"","date":"0000-00-00","name":"","id":"638"},{"todo":"janis rough","date":"0000-00-00","name":"","id":"637"},{"todo":"janis rough","date":"0000-00-00","name":"","id":"636"},{"todo":"janis rough","date":"0000-00-00","name":"","id":"635"},{"todo":"janis rough","date":"0000-00-00","name":"","id":"634"},{"todo":"bark","date":"0000-00-00","name":"Junior","id":"629"},{"todo":"bark","date":"0000-00-00","name":"Junior","id":"628"},{"todo":"car wash","date":"0000-00-00","name":"Janis Rough","id":"624"},{"todo":"","date":"0000-00-00","name":"","id":"623"},{"todo":"","date":"0000-00-00","name":"","id":"621"},{"todo":"","date":"0000-00-00","name":"","id":"622"},{"todo":"","date":"0000-00-00","name":"","id":"619"},{"todo":"","date":"0000-00-00","name":"","id":"620"},{"todo":"","dat2013-01-04","name":"Janis Rough","id":"625"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"633"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"632"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"631"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"630"}]
OR
{"todo":"","date":"0000-00-00","name":"","id":"641"},{"todo":"","date":"0000-00-00","name":"","id":"642"},{"todo":"","date":"0000-00-00","name":"","id":"643"},{"todo":"","date":"0000-00-00","name":"","id":"644"},{"todo":"","date":"0000-00-00","name":"","id":"645"},{"todo":"","date":"0000-00-00","name":"","id":"646"},{"todo":"shopping","date":"2013-01-04","name":"Janis Rough","id":"627"},{"todo":"shopping","date":"2013-01-04","name":"Janis Rough","id":"626"},{"todo":"car wash","date":"2013-01-04","name":"Janis Rough","id":"625"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"633"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"632"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"631"},{"todo":"do laundry","date":"2013-02-14","name":"janis rough","id":"630"}]
Maybe these are actually the same, so it appears, but in the console the previous output from php has the word "object" added to it after sent to the browser. The output above is from hitting the php page after I hit the jquery page. So the firebug console has the word "object". I don't know why that would should up in the console but not on the php page but in any case neither one gets it right. Below is the beginning of the output from firebug console. Is that how firebug is interpreting the string? In any case I simply need to get rid of the brackets and the AJAX call should work. It worked before I don't know how the brackets got in there. I removed some of the lines from the center so the output wouldn't be so long.
thanks,
GET http://localhost:8888/todo/form_handler1.php
200 OK
484ms
jquery.min.js (line 5
[Object { date=
"0000-00-00"
, id=
"609"
, todo=
""
, more...}, Object { date=
"0000-00-00"
, id=
"608"
, todo=
""
, more...}, Object { date=
"0000-00-00"
, id=
"607"
, todo=
""
, more...}, Object { todo=
"ddd"
, date=
"0000-00-00"
, id=
"606"
}, Object { todo=
"ddd"
, date=
"0000-00-00"
, id=
"605"
}, Object { todo=
"ddd"
, date=
"0000-00-00"
, id=
"604"
}, Object { date=
"0000-00-00"
, id=
"603"
, todo=
""
, more...}, Object { date=
"0000-00-00"
, id=
"602"
, todo=
""
, more...}, Object { date=
"0000-00-00"
, id=
"601"
, todo=
""
, more...}, Object { todo=
"laundry"
, date=
"0000-00-00"
, name=
"janis rough"
, more...}, Object { todo=
"janis rough"
, date=
"0000-00-00"
, id=
"640"
}, Object { todo=
"janis rough"
, date=
"0000-00-00"
, id=
"639"
}, Object { date=
"0000-00-00"
, id=
"638"
, todo=
""
, more...}, Object { todo=
"janis rough"
, date=
"0000-00-00"
, id=
"637"
}, Object { todo=
"janis rough"
, date=
"0000-00-00"
, id=
"636"
}, Object { todo=
"janis rough"
, date=
"0000-00-00"
, id=
"635"
}, Object { todo=
"janis rough"
, date=
"0000-00-00"
, id=
"634"
"
, id=
"614"
, todo=
""
, more...}, Object { date=
"do laundry"
, date=
"2013-02-14"
, name=
"janis rough"
, more...}]
todo1.html (line 121)