Skip to content Skip to sidebar Skip to footer

Mootools - Check For Css Or Js Files

I know for append new css or js file I can use Asset class. But if i want check if css or js files are present before Asset?? There is a way? Thx

Solution 1:

you can assign ids to your assets as you bring them in and check against the dom for their presence:

Asset.javascript("https://github.com/DimitarChristoff/tippable/raw/master/Source/tippable.js", {
    id: "someid",
    onload: function() {
        alert("loaded");
        if (document.id("someid"))
            alert("already loaded");
    }
});

Post a Comment for "Mootools - Check For Css Or Js Files"