Escaping HTML in jQuery so it's valid
问题 I've followed advice from firebug and W3C links, however when Firebug confirms all is valid, W3C does not seem to like it and vice versa. All I'm doing is this: return '<a href="#"></a>'; I believe I should use a backslash infront of the forward slash, though as XHTML, the start tag needs to be escaped as well? Can anyone shed any light on this. Thanks. 回答1: Short answer: Don't use XHTML on the client. Almost the short answer: Put your JavaScript in external files Longer answer: If you really