从JSON响应中删除第一行

我目前的代码是:

$.getJSON("https://www.domain.com/someapi/callback=?", function(data){ $.each(data, function(i,item){ alert(item.x); }); }); 

现在我收到一个错误,因为他们在我的json响应的顶部添加了一行。 有没有办法摆脱那条线?

谢谢!

更新:

我也尝试过这样的事情:

 $.ajax({ url: "https://www.domain.com/someapi/callback=?", type: "get", success: function (data) { alert(data) } }); 

但这是一个跨域调用,所以我得到了这个错误。

制作ajax正常请求

 $.ajax({ url : "https://www.domain.com/someapi/callback=?", success : function(result){ // So here we get the result json with an error // So lets say the response is something like this /* There was an error on line 35 { json : true } */ // So we remove everything before the first '{' result = result.replace(/[^{]*/i,''); //We parse the json var data = JSON.parse(result); // And continue like no error ever happened $.each(data, function(i,item){ alert(item.x); }); } }); 

我希望这项工作。 (必须从服务器启用跨域请求)