Good day to all. There is an iframe on the page. The page that this iframe needs to load is loaded within 1-3 seconds instantly. But the data in this page is loaded for 10 seconds (everything is based on Javascript sockets and some other rubbish ..). Suppose, as soon as the iframe loaded this page, some field in its source code looks like this:

 <input type="text" id="number" value="unknown" /> 

But after about 10 seconds, everything looks like this:

 <input type="text" id="number" value="1234567890abc" /> 

As far as I know, Javascript is single-threaded and does not have rights to run any actions in new threads. So now the question. How to create a Handler, which will, for example, give me a message in the browser console that there are no fields in the iframe with values unknown ? It should look like this:

 ... <iframe id="page" ...></iframe> ... <script type="text/javascript"> ... document.getElementById("page").добавитьСканер({ while (true) { if (document.getElementById("page").неСодержитЗначений("unknown")) { Console.log("Страница загружена!"); break; } } } ... </script> ... 

    0