即给出一个空白页面,下面的脚本,但火狐工作正常 [英] ie gives a blank page with the below script, but fire fox works fine

查看:85
本文介绍了即给出一个空白页面,下面的脚本,但火狐工作正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

i尝试使用用户偏好更改我的网页字体。我使用cookie来获取用户的偏好,以便选择的字体大小保留为下一届会议。我正在使用cookie设置更改样式表,下面显示的是我的代码

Hi All
i am trying to change the font of my web page with user preference.i made use of cookie to get the user''s preference, so that the font size selected will remain for the next session. i am changing the style sheet with the cookie set, The below shown is my code


展开 | 选择 | 换行 | 行号

推荐答案

当用户点击Text size链接时,它将调用Toggle字体函数,该函数将使用readCookie函数读取cookie值,如果cookie值设置较小,则会将其更改为big并且调用setFont函数,


我的问题发生在setFont函数中,它进入了设置Font函数的正确情况,之后它给出了一个空白的页面,但是在火狐中它工作正常,


您的任何建议都会非常感激。
when the user clicks on the Text size link it will call the Toggle font function, that will read the cookie value using readCookie function, if the cookie value set is small it will change it to big and the the call the setFont function,

My problem occurs in the setFont function, it goes inside the proper case of the set Font function, after that it gives a blank page in ie, but in fire fox it works fine,

Any of your advise would be much appreciated.


即便如此我也能看到下载css文件 ie中的信息,但之后它给出了空白页。
Even i can see the "downloading css file " info in the ie , but after that it gives the blank page.


页面加载后你不能使用document.write。它将再次打开文档进行写入,这不是您想要的。有关使用带有cookie的备用样式表,请参阅此链接
You can''t use document.write after the page has loaded. It will open the document again for writing which is not what you want. For using alternate stylesheets with cookies, see this link.


这篇关于即给出一个空白页面,下面的脚本,但火狐工作正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆