Coder Social home page Coder Social logo

Comments (5)

emn178 avatar emn178 commented on June 25, 2024

sorry, I don't understand.

from jquery-lazyload-any.

hyingzi avatar hyingzi commented on June 25, 2024

刚看到您是**的,那我打中文。。。英文不好~
因为插件是抓取注释里的图片激活加载的,如下

<div class="lazyload">
  <!--
    <img src="image.png" />
  -->
</div>

在有些场景(ajax、模板等)使用中,需要动态的去插入这些代码,如

var tpl = '<div class="lazyload"><!--<img src="image.png" />--></div>'

// 写入
document.getElementsByTagName("body")[0].innerHTML = tpl
$(".lazyload").lazyload()

这个的时候,在ie8或者某些firefox版本中,写入的其实是

<div class="lazyload"></div>

也就是说,注释里的内容被过滤掉了……

还有一种情况,网站如果使用cdn的并且开启代码优化的话,注视也会被过滤掉…

所以,注释这种的方式好像不是很安全

from jquery-lazyload-any.

emn178 avatar emn178 commented on June 25, 2024

Hi,

感謝你的建議, 未來將考慮增加其他的方式改善這個問題, 可能的方式是用屬性實現

from jquery-lazyload-any.

emn178 avatar emn178 commented on June 25, 2024

Hi, 805063c 新增兩種使用方式可解決此問題

from jquery-lazyload-any.

hyingzi avatar hyingzi commented on June 25, 2024

非常感谢!

from jquery-lazyload-any.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.