hosemaria
unread,Mar 20, 2009, 8:42:34 AM3/20/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.