$.ajax({ url: 'http://www.examplepage.com', success: function(responseHTML) { var someText = $(responseHTML).find('#myDiv').html(); // This part returns a script error and aborts anything else from here }, dataType: 'html' });
The problem is that examplepage.com has a script error (Syntax error, unrecognized expression: {"One":"1") that is messing up anything that searches responseHTML. How can I ignore this error because all I need is a section of html that is not affected by the errant script.