RJ Solusoft

in jsp page write your scipt

$(function(){
var url=”www.anyotherurl.com”;

$.getJSON(url+”&jsoncallback=?”,
function(data) {
alert(data.key);
});
})

in another url return json object in jsoncallback() method like below
boolean result = false;
JSONObject resultJson = new JSONObject();

try {
resultJson.put(“result”,result);
} catch (JSONException e) {
e.printStackTrace();
}
response.setContentType(“application/json”);
return jsoncallback+”(“+resultJson.toString()+”)”;
}

When the script is called it will to another url. In another url create json and return that json in jsoncallback().

View original post

Advertisements