Q:

Requesting invalid JSON file using JSONP

I'm requesting JSON file which has an invalid structure:    
{}&&{
    "result": {
        "data": "01",
        "id": "02"
    }
}

I can't change JSON. It's on external server.
Firebug returns syntax error pointing to the && characters. 
What should I do to get this invalid JSON?
My script:
<script src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {      
$.ajax({
url:"http://different-domain.com",
dataType: 'JSONP',
success: parseJSON
function parseJSON(data){
// do stuff with json
}
});
</script> 

A:

You can use complete not a success. Than you could get RAW response before error comes. Then you can substr invalid chars while not to got parsed JSON:
$.ajax({
url:"http://different-domain.com",
dataType: 'JSONP',
complete: function(xhr){

    var raw= xhr.responseText
      , json
      , err
      ;

    while(raw.length && err)
    {
      // rewind state
      err= false;
      try {
        //parse JSON
        json= parseJSON(raw);
      }
      catch (e)
      {
        // Mark loop as invalid
        err= true;
      }

      // Get out if json is valid and parsed
      if (!err) break;

      // If loop is not broken try another one time: cut one char from invalid json and go on.
      raw= raw.substr(1);
    }

    if (!err)
    {
      console.log('YAPPPEEEEE :)');
    }
    else
    {
      console.log('NOPE :(');
    }
}

