iFrame src change event detection?

前端 未结 7 1336
夕颜
夕颜 2020-11-22 08:02

Assuming I have no control over the content in the iframe, is there any way that I can detect a src change in it via the parent page? Some sort of onload maybe?

My l

7条回答
  •  -上瘾入骨i
    2020-11-22 08:47

    Since version 3.0 of Jquery you might get an error

    TypeError: url.indexOf is not a function

    Which can be easily fix by doing

    $('#iframe').on('load', function() {
        alert('frame has (re)loaded ');
    });
    

提交回复
热议问题