解决thickbox ajax提交form覆盖父窗口及ajax容器中汉字乱码的问题(原创)

一,汉字乱码

    这主要是由于ajax传回的数据中使用了utf-8编码,解决办法在被请求的文件第一行写上 header(‘Content-Type: text/html; charset=gb2312’);  这个是php的语法,其它语言自己变化一下.

二 覆盖父窗口

    其实我用了一个变通的变法,就是将内容提交到父窗口的iframe里,像这样

<form action=”abc.php” method=”post” name=”frm_mi” id=”frm_mi” target=”ifrm_edit_hidden” >

然后在父窗口中写下面这行代码

<iframe name=”ifrm_edit_hidden” height=”0″ width=”0″ style=”display:none;”></iframe>

收工



发表评论

您的电子邮箱地址不会被公开。

9 + 1 =