在jQuery中Html()来encode 输入的内容时,它不会转义“‘ 增加以下就可以了: code //test var afterEncoded=htmlEncode(value);; afterEncoded=afterEncoded.replace(/['"]/g,""");