dinbror / blazy

Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.
http://dinbror.dk/blazy
MIT License
2.63k stars 355 forks source link

Parsing data-src with URL parameters #171

Closed mglind closed 5 years ago

mglind commented 5 years ago

<div class="b-lazy" data-src="https://somedomain.com/file/3485863211?resize=width:1920&crop=top:643|left:0|width:2018|height:728&order=crop,resize&quality=55&c=14&a=141e65e8"></div>

var bLazy = new bLazy();
</script>

Above is a simplified version of the issue. When bLazy makes the Async call it returns an error in regards to not being able to get "left:0" which is part of the URL. If I get rid of the query params on the URL it works fine. So, in the parsing of the data-src attribute somehow the URL is not returned correctly.

dinbror commented 5 years ago

Try encoding the colon (%3A)

mglind commented 5 years ago

That resolved my issue. Thanks for the quick response.