GoogleChromeLabs / wp-native-lazyload

WordPress plugin to lazy-load media using the native browser feature.
https://wordpress.org/plugins/native-lazyload/
Apache License 2.0
51 stars 13 forks source link

The fallback doesn't work on IE10 #13

Closed ericvalois closed 4 years ago

ericvalois commented 5 years ago

Issue Overview

The fallback script seems to work fine on IE11 but not on IE10. Here is the error:

SCRIPT5007: Unable to get property 'src' of undefined or null reference 
lazyload.js, line 1 character 1659

Steps to Reproduce (for bugs)

  1. Activate the default WordPress theme Twenty Nineteen.
  2. Deactivate all WP plugins except for Native Lazyload
  3. Add images to a page with the editor
  4. Test the page on a VM with Windows 7 and IE10

    PHP 7.3 - IE10 - Windows 7 - Native Lazy load v1.0.1 - WordPress 5.2.3

    Expected Behavior

    Images should display.

Current Behavior

There are empty spaces instead of images.

Screenshots / Video

https://cl.ly/e220a8ac07d9

felixarntz commented 5 years ago

Thanks for the report @ericvalois!

Apparently IE < 11 doesn't support the dataset property on elements, so one needs to rely directly on the data attributes instead.

I'll create a fix for this shortly.