zoukankan      html  css  js  c++  java
  • 一个小bug 看浏览器内核加载页面的方式

    近日工作遇到一个另人困惑的问题,同一个页面,用不同的浏览器访问会有不同的问题

    Firefox和IE浏览器一切正常没有问题,但是当用Webkit内核浏览器访问时,验证码无论如何通不过验证。

    浏览服务器端日志,发现提交的数据都是一样的。

    再仔细分析日志,发现加载流程不一样的:

    WebKit流程如下:

    Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:25) [GET]
    Processing SimpleCaptchaController#simple_captcha (for 127.0.0.1 at 2011-04-29 17:37:29) [GET]
    Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:30) [GET] //这里发生302错误
    Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:31) [GET]
    Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:32) [GET] //这里发生302错误
    Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:33) [GET] //这里发生302错误
    Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:35) [GET]
    发现index加载了三次,导致验证码更新了三次(访问index会更新验证码)但是却只加载了一次。 

    Firefox和IE内核加载流程:
    Processing CharmsController#index (for 127.0.0.1 at 2011-04-29 17:37:25) [GET]
    Processing SimpleCaptchaController#simple_captcha (for 127.0.0.1 at 2011-04-29 17:37:29) [GET]
    Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:30) [GET] //这里发生302错误
    Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:32) [GET] //这里发生302错误
    Processing SiteController#show_page (for 127.0.0.1 at 2011-04-29 17:37:33) [GET] //这里发生302错误

    但是在IE下index却只加载了一次

    不知道为什么WebKit会对同一个页面加载三次,难道是因为发生了302错误?
    刚刚又测试了一下,把找不到的图片都添加上,则页面只加载一次,看来WebKit在页面上有图片找不到时会重新请求页面,但次数是多少我没有测试。 

  • 相关阅读:
    键盘弹出后上提view隐藏后下拉view还原并修改scroll过程中旋转屏幕到竖屏view显示错误
    iOS UI Element Usage
    ios notification
    retain和copy还有assign的区别
    UVA-11728 Alternate Task
    UVA-11490 Just Another Problem
    UVA-10127 Ones (数论)
    UVA-10710 Skyscraper Floors (找规律+幂取模)
    UVA-10539 Almost Prime Numbers
    UVA-10692 Huge Mods
  • 原文地址:https://www.cnblogs.com/heimirror/p/2033146.html
Copyright © 2011-2022 走看看