$.getJSON() error - InvalidLabel
Hi
This is my jsp file.
testjson.jsp
- <%@ page contentType='text/javascript'%>
- <% response.setContentType("application/x-javascript"); %>
- {"foo": "The quick brown fox jumps over the lazy dog.", "bar": "ABCDEFG", "baz": [52, 97]}
And this is my html file.
- <html>
- <head>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type='text/javascript'></script>
- <script type='text/javascript'>
- $(document).ready(function(){
- $.getJSON('http://localhost:8080/testjson.jsp?callback=?', function(data){
- alert(data.foo);
- });
- });
- </script>
- </head>
- <body>
- <div id='test'>
- test
- </div>
-
- </body>
- </html>
When I run my code It says Invalid Label in firefox. I've tried google on this but couldn't find anything useful.
Please if anyone can explain me why this error is shown and what needs to be done. It's really urgent.
Thanks
Shwetanka