Thanks, but its actually a full webpage im returning. Is there a way of only returning the section of html I want, similar to load('http:// www.examplepage.com #one')?
On Aug 15, 12:07 am, "comslash.com" <comsl...@gmail.com> wrote: > I don't think you can ignore this error ... It looks like you are > returning a JSON response, try turning data type to json and then > insert responseHTML.One into your find command ... as "One" is your > object ... see below. > > $.ajax({ > url: 'http://www.examplepage.com', > success: function(responseHTML) { > var someText = $(responseHTML.One).find('#myDiv').html(); > // you may need $('#'+responseHTML.One) ... if you are looking for > say an id ... or "." + ... if its a class > }, > dataType: 'json' > > }); > > On Aug 14, 9:20 pm, nick <nboutel...@gmail.com> wrote: > > > > > $.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.