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在页面上有图片找不到时会重新请求页面,但次数是多少我没有测试。 

  • 相关阅读:
    layui表格数据统计
    浅谈权限控制
    搜索栏实时更新查找内容
    虚拟域名
    关于阿里云服务器安装了Apache开放80端口访问不了网页
    验证码思路
    计算标准差 Exercise07_11
    倒置数组 Exercise07_12
    找出最小元素的下标 Exercise07_10
    找出最小元素 Exercise07_09
  • 原文地址:https://www.cnblogs.com/heimirror/p/2033146.html
Copyright © 2011-2022 走看看