(document).height()与$(window).height()值相等的问题原因

2017-01-17 10:36:02

原因:访问的Html文档不是标准的<!DOCTYPE html>导致jquery不能精确的算出高度

一开始做的时候是能获得正确的高度的,后来我又添加了一些样式,结果,这个高度计算的就有点高了,找了半天也没有找到愿意。


后来通过谷歌查询源代码,结果发现如下。

QQ截图20170116174134.png


突然明白原因了,我的网页是php后端渲染的,在渲染style的时候我出现了错误,把style渲染到了文档的外面,所以会出现这样的错误。

  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

  • 2017-11-19 00:17:51

    Java如何获取Date的“昨天”与“明天”示例代码

    最近在做项目的时候用到Date和Calendar比较多,而且用到的方式也比较全,突然想到一个问题,Java如何获取Date的"昨天"与"明天",也就是前一天和后一天呢?思考后写出了方法,想着万一以后用到,就总结出来,也方便有需要的朋友们参考借鉴,下面来一起看看吧。