We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
先说声不好意思,在issue里提这样的问题 源码:
var name = 'img_' + (+new Date()); entry[name] = image; image.onload = image.onerror = function () { entry[name] = image = image.onload = image.onerror = null; delete entry[name]; };
为什么要将 image 挂在entry对象上?然后是这个函数执行完后image不就销毁了吗?为什么还要通过监听onload和onerror来销毁?
The text was updated successfully, but these errors were encountered:
我明白了,正是因为image会被销毁,请求有可能被阻止发不出去,所以需要将image保持在一个对象上。 一开始这样想过,但测试了下请求是正常的,直到刚刚看到这篇文章用new Image().src作LOG统计的一个注意事项。
Sorry, something went wrong.
No branches or pull requests
先说声不好意思,在issue里提这样的问题
源码:
为什么要将 image 挂在entry对象上?然后是这个函数执行完后image不就销毁了吗?为什么还要通过监听onload和onerror来销毁?
The text was updated successfully, but these errors were encountered: