html - jQuery Ajax request - href target ends up outside tags -


I'm using jQuery to call AJAX. The call is processed and gives the expected data, but when I $ ("# newsLetterForm"). I use Html; link address tag

Ajax Request

  $ Ajax ({async: true, data: $ datatused, datatype: 'html', preceded: function () {$ ('# newsletter form') .HTML ('& lt; img id = "ajaxwait" src = "/ images / Ajaxwait.gif "alt =" waiting "/> ');}, error: function (data, textstats, jquxhr) {$ (' # newsletter form ') .html (data)); timeout: 3000, type Do: 'Post', URL: 'http://myurl.com',});   

Alert return data - Notice support tag

  There was an error processing your request. Please request your request & lt; Click on a href = "foo.html" onclick = "onmouseover =" "onmouseout =" "/> Help & lt; / A & gt;     Error processing your request, please request your request & lt; Click on a href = "foo.html" onclose = "onmouseover =" "onmouseout =" "/> gt; & Lt; / A & gt; Help   

Why is this happening?

Your anchor is being closed twice, or better explained, the opening anchor tag The self-closing must be a response to the server:

  & lt; A href = "foo.html" onclick = "onmouseover =" "onmouseout =" "& gt; Support & lt; / A & gt;   

Notice I'm just " before" Help "instead of" & gt;

Comments