Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.51 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  4. <title>Insert title here</title>
  5. <%
  6. class Foor{
  7.     public String getJSON(){
  8.         return "{foo:'bar'}";
  9.     }
  10. }
  11.  
  12. Foor myfoo = new Foor();
  13.  
  14. %>
  15. <script language=javascript>
  16.  
  17. // using just <%= myfoo.getJSON() %> would output this
  18. var myjson = {foo:'bar'}
  19.  
  20. // using dojo.fromJson('<%= myfoo.getJSON %>') would output this
  21. var myjson = {"foo":"bar"}
  22.  
  23. alert(myjson.foo);
  24. </script>
  25. </head>
  26. <body>
  27.  
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement