i have a jsp on a server that returns me a JSON like this: {"link":"LINK_TEST","title":"TITLE_TEST"}
I am trying to get this data from a client html page but i can do it.
this is the jsp code:
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="org.json.simple.JSONObject"%>
<%
    JSONObject json = new JSONObject();
    json.put("title", "TITLE_TEST");
    json.put("link", "LINK_TEST");
    out.print(json);
    out.flush();
%>
The jsp looks like this: {"link":"LINK_TEST","title":"TITLE_TEST"}
And this is the client side code:
<!DOCTYPE html>
    <html>
    <head>        
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script>
            $.ajax({
                url : 'http://my_ip:my_port/json.jsp',
                data : { search: 'test' },
                dataType: 'json',
                success : function(json) {
                var ob = jQuery.parseJSON(json);
                alert(ob.link+" "+ob.title);
                document.getElementById("uno").innerHTML = ob.link;
                document.getElementById("dos").innerHTML = ob.title;
                }
            });
    </script>
    </head>
    <body>
    <h1 id="uno"></h1>
    <h1 id="dos"></h1>
    </body>
    </html>
    
dataType: ;json', so you can remove thevar ob = jQuery.parseJSON(json);line. Please check the console for any other errors. Also note that jQuery 1.5.1 is very outdated. You should be using 1.12 at the oldest.