标签存档: javascript

Apr 20 2016

gyp http 404 error while updating package in Atom

 Description

While updating plugins on Atom, it often fails. If you try using apm to update manually, the gyp reports a 404 error.

继续阅读 »

Oct 22 2015

javascript使用image.height和image.width获取图片宽高值为0,获取失败

当我使用javascript创建一个图片对象:

我以为可以这样获取图片的宽高值:

在某些电脑上的谷歌浏览器和IE11浏览器上,以上代码工作正常。但是火狐在第一次打开时却报出宽高值均为0。如果按F5刷新页面,火狐又能正确获取宽高值了。按Ctrl+F5忽略缓存的话,仍能复现这个问题。 继续阅读 »

Oct 19 2015

JS get width() and height() of image 0 unexpectedly by using image.height and image.width

While creating a image object:

I thought I can get the height and width of the image like this:

In Chrome and IE11 on some computers, the code works as expected. But in Firefox, the height and width get 0 at the first time.If you refresh the page by pressing F5, It turns to be get the right value. Try testing it by pressing Ctrl+F5. 继续阅读 »

» 新文章