开发者

jQuery $.post & $.append & IE6

I'm having a weird problem with jQuery and IE6. Script works on IE7+ and with all other browsers I have tried it.

I can't post the full script, but what it does is this:

$.post("file.php",{'foo':'bar'},function(data){ $('#target').append(data) })

When I run the code in IE6, #target just shows ? and a white char with a hole in the middle. I have no idea what this second char is.

My initial thought was that this was some sort of content-type problem because the file.php just echoes answer without any header information. I added Content-type: text/html with header() but didn't help.

Any 开发者_Python百科suggestions?


Very probably you see a character set issue.

Add a Content-Type header to your PHP response that correctly reflects both the type and the encoding your data is in.

header('Content-Type: text/html; charset=utf-8;') // for example
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜