I need to make a JSONP request and i am using the following code:
var jsonp_url = "url?callback=?";
$.getJSON(jsonp_url,function(data) {
alert("success");
});
In the server side:
$callback = $request->getParameter('callback');
echo $callback.'{'. json_encode(array('html'=> 'test')).'}';
In the firebug console the response appears like this:
jsonp1286547104165{{"html":"test"}}
The problem is that the callback function of $.getJSON method is never executed.
What i am missing?