dojo删除div

    技术2022-07-11  132

    dojo删除div

    In an effort to get better with the Dojo Toolkit, I've decided to port yet another one of my previous posts: Remove Broken Images Using MooTools or jQuery. Broken images are an eyesore to any website so there's no point to keeping them in the page. Here's how you can remove them on the client side.

    为了更好地使用Dojo Toolkit,我决定移植我以前的另一篇文章: 使用MooTools或jQuery删除损坏的图像 。 损坏的图像会困扰任何网站,因此没有必要将其保留在页面中。 这是在客户端上删除它们的方法。

    Dojo JavaScript (The Dojo JavaScript)

    dojo.ready(function() { dojo.query('img').forEach(function(img){ dojo.connect(img,'onerror',function() { dojo.destroy(img); }); }); });

    Just as simple as jQuery and MooTools -- just a different syntax!

    就像jQuery和MooTools一样简单-只是语法不同!

    翻译自: https://davidwalsh.name/remove-images-dojo

    dojo删除div

    相关资源:jdk-8u281-windows-x64.exe
    Processed: 0.011, SQL: 9