unnecessary quotes around json values

17 views
Skip to first unread message

hosemaria

unread,
Mar 20, 2009, 8:42:34 AM3/20/09
to php-json
I have to send JSON data from PHP server to Javascript. JSON data
after json_encode() looks like this:

{"colNames":["Measure ID","Name"],
"url":"measure_JSON.php?nd='+new Date().getTime()",
"editurl":"measure_add.php",
"datatype":"json",
"sortname":"name",
"imgpath":"..\/js\/jqgrid\/themes\/steel\/images",
"viewrecords":true,
"cellEdit":true,
"sortorder":"asc",
"height":"100%",
"toolbar":[true,"top"],
"cellsubmit":"clientArray",
"multiselect":true,
"loadui":"block",
"pager":"#pager2,#pager",
"rowNum":100,"rowList":[10,20,30,50,100],
"caption":"Measure",
"colModel":
[{"name":"id_item","index":"id_measure","editable":true,"width":30},
{"name":"name","index":"name","editable":true,"width":130}]}

1. Second line
"url":"'measure_JSON.php?nd='+new Date().getTime()",
How to get rid of quotes(") around "'measure_JSON.php?nd='+new Date
().getTime()"?
json_encode add (") quotes automaticaly and i can't find option to
switch it off.
Javascript need to run operation new Date().getTime(). With quotes it
is treated as string so no execution is performed.
Reply all
Reply to author
Forward
0 new messages