Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Insert title here</title>
- <%
- class Foor{
- public String getJSON(){
- return "{foo:'bar'}";
- }
- }
- Foor myfoo = new Foor();
- %>
- <script language=javascript>
- // using just <%= myfoo.getJSON() %> would output this
- var myjson = {foo:'bar'}
- // using dojo.fromJson('<%= myfoo.getJSON %>') would output this
- var myjson = {"foo":"bar"}
- alert(myjson.foo);
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement