Syntax error, unrecognized expression - but why?
Hi,
I've been going round and round in circles with this for the last hour, and its driving me up the wall :S
The code is:
- $.post('/cgi-bin/links/lead_contact_new.cgi', $('#contactForm').serialize() , function(data) {
- var errormsg = $(data).find('#error');
- console.log(errormsg);
- if (errormsg.length > 0) {
- console.log("Seems to be an errror:" + errormsg);
- } else {
- console.log("Looks ok");
- }
- });
The returned HTML is:
<html><body><div id="error">Desolee, Adresse e-mail incorrect.Desolee, Entrez votre nom</div></body>
</html>
..yet it always fails at the find() with:
Error: Syntax error, unrecognized expression: <html><body><div id="error">Desolee, Adresse e-mail incorrect.Desolee, Entrez votre nom</div></body></html>
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.0.min.js
Line 2
I've tried it using filter() as well, but to no avail with it either.
Anyone got any ideas?
TIA
Andy