postData在encode和unencode,最终导致在后台Servlet中得到得到数据+被空格代替,使得script中的index += 1;变成了index = 1;从而导致后台Java代码在跑script出现死循环。 在网上搜索,发现content-type使用application/x-www-form-urlencoded后: [来自http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1]写道 代码如下: Control names and values are escaped. Space characters are replaced by `+', and then reserved characters are escaped as described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A').