【问题标题】:Captcha image shown as strange symbols in Firefox验证码图像在 Firefox 中显示为奇怪的符号
【发布时间】:2011-07-07 07:57:46
【问题描述】:

我在 jsp 中使用this 验证码。我使用 iframe 通过以下代码调用 jsp:

 <iframe id="captchaframe"  align="center" name="captchaframe" src="captcha.jsp" width="120" height="40" scrolling="no"
      frameborder="0" marginheight="-10" marginwidth="-10"/></iframe>    

使用资源管理器,一切都像这张图片一样:

但在 Firefox 中,字符变成了与这张图片完全一样的东西:

我该如何解决这个问题?

【问题讨论】:

    标签: firefox jsp cross-browser captcha


    【解决方案1】:

    我猜 Firefox 无法将您的 jsp 文件的输出识别为图像。您是否将 mime 内容类型设置为图像?

    http://www.w3.org/Protocols/rfc1341/4_Content-Type.html

    【讨论】:

    • 谢谢,将内容类型设置为 image/jpeg 解决了我的问题。
    猜你喜欢
    • 2011-12-23
    • 1970-01-01
    • 2019-03-22
    • 2023-03-11
    • 2014-09-14
    • 1970-01-01
    • 2013-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多