問題:
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?假設我無法控制 iframe 中的內容,有什麼方法可以通過父頁面檢測其中的 src 更改嗎? Some sort of onload maybe?也許是某種加載?
My last resort is to do a 1 second interval test if the iframe src is the same as it was before, but doing this hacky solution would suck.如果 iframe src 與以前相同,我最後的手段是進行 1 秒的間隔測試,但是執行這個 hacky 解決方案會很糟糕。
I'm using the jQuery library if it helps.如果有幫助,我正在使用 jQuery 庫。
解決方案:
參考一: https://en.stackoom.com/question/ABu9參考二: https://stackoom.com/question/ABu9