簡體   English   中英

$(window).load在IE11中不起作用

[英]$(window).load not working in IE11

$(window).load在IE中無法正常運行,但在Chrome中可以正常運行。

$(document).ready(function()不會解決我的問題。我想在整個頁面加載完成后調用我的函數,任何人都可能遇到相同的情況。

$(window).load(function () {
    $(".testdiv #Value").each(function () {
        $(this).html($(this).html().replace(/:/g," > "));
    });
})

 <div id="Value"> <input type="checkbox" id="test1" name="1" data-displayvalue="tes1" value="1"> <label for="test1">test1</label> </div> <div id="Value"> <input type="checkbox" id="test2" name="2" data-displayvalue="test2" value="2"> <label for="test2">test2</label> </div> <div id="Value"> <input type="checkbox" id="test3" name="3" data-displayvalue="test3" value="3"> <label for="test3">test3</label> </div> <div id="Value"> <input type="checkbox" id="test4" name="4" data-displayvalue="test4" value="4"> <label for="test4">test4:yuv</label> </div> <div id="Value"> <input type="checkbox" id="test5" name="5" data-displayvalue="test5" value="5"> <label for="test5">test5:xyz</label> </div> 

過去,我已經成功地使用了此方法,以等待所有內容完全加載:

$(window).bind('load', function() {
    //after everything has loaded
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM