Skip to content
New issue

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

Image preload won't work with cross-domain image #6

Closed
kayue opened this issue Dec 24, 2014 · 1 comment
Closed

Image preload won't work with cross-domain image #6

kayue opened this issue Dec 24, 2014 · 1 comment

Comments

@kayue
Copy link

kayue commented Dec 24, 2014

If user is using a CDN or loading external image, the AJAX preload method won't work because of cross-domain issue.

https://github.com/gocom/dense/blob/master/src/dense.js#L211-L224

I think creating an Image element is better here.

$img = new Image();
$img.src = "//preload-me.com/image.jpg";
@gocom
Copy link
Owner

gocom commented Mar 15, 2015

It's not pre-loading any data; it's sending HEAD request to verify whether the image exists.

@gocom gocom closed this as completed Mar 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants