Im trying to pass to javascript method declared in my aspx page , a json as string,
<a href="javascript: void(0)" onclick="javascript: JsonParser('{"root":"assd3444"}')">
but i got always same error:
Uncaught SyntaxError: Invalid or unexpected token
in the same row that i posted above, in browser.
Method is empty and declared in top of the page :
function JsonParser(jsonString) {
debugger;
// do something with json
}
How i can pass json string to a javascript method from aspx ?
I have also tried to put \ before double quotes in json string but it still doesn't work.
Thanks