Hi i am new to dojo and javascript. I am trying to get mysql data into json format via php.
content of actual jsonfile which is actually php output. Okay so the error message I am missing a right bracket, but where?
Maybe I have just been looking at this two long. I don't know where I went wrong the brackets and braces seem to mirror each other
{items:[
{links:['first','prev',' dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=2','Bsearch')','dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=6','Bsearch')']},
{Data:['39','author of book','dewy1','title2']},
{pageC:['Page 1/6']}
]}
//error message:
"missing ] after element list"
//error details:
"()@:0\neval(\"(
{items:[
{links:['first',' prev',' dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=2','Bsearch')',' dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=6','Bsearch')']},
{Data:['39',' author of book',' dewy1',' title2']},
{pageC:['Page 1/6']}
]})\")@:0\n(\"
{items:[
{links:['first',' prev',' dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=2','Bsearch')',' dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=6','Bsearch')']},
{Data:['39',' author of book',' dewy1',' title2']},
{pageC:['Page 1/6']}
]}\")
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n([object XMLHttpRequest])
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n([object XMLHttpRequest])
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n([object Object])
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n()
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n([object Object])
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n([object Object])
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n([object Object])
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n(450)
@http://localhost/dojo_tut/dojo/dojo/dojo.js:20\n@:0\n"

A quick guess is that it is
A quick guess is that it is linked to the use of the single quote, '. The above has single quotes embedded within single quotes. The parser is probably not interpreting the string the way you want it to.
For example, your "dojoajax" info is "enclosed" in single quotes 'dojoajax(....)'
but within the dojoajax parens you have additional single quoted data. I doubt a parser would treat:
'dojoajax('dojo_tut/BookForm.php?Bsearch_next_page=2','Bsearch')'
like (what I think you want):
'dojoajax("dojo_tut/BookForm.php?Bsearch_next_page=2","Bsearch")'
but, I may be missing something.
thanks
that was it!!!
also note that technically
also note that technically you are supposed to quote the keys as well for JSON.
"items":[....]