@jasen
To check if an iframe is empty, you can use JavaScript to check if it has any content inside it. Here is a simple example to demonstrate how you can achieve this:
1
|
const iframe = document.querySelector('iframe'); |
1 2 3 4 5 |
if (iframe && !iframe.contentDocument) { console.log('The iframe is empty'); } else { console.log('The iframe is not empty'); } |
This code snippet will check if the iframe is empty or not based on whether its contentDocument property is null or not. You can further refine this check based on your specific requirements.