Problems with using document.write ()
Posted: Mon Apr 13, 2020 9:44 pm
Hi, apparently Google doesn't like the use of document.write () because it makes mobile pages slower, I've been reading a lot on the subject, the recommendation is to replace that part of the code ... In the Google Chrome console appears a violation on one of my sites for using document.write () (this is used by the incomig traffic code), I need to solve it.
I wrote all this to one of his boys through ICQ, he asked me for more details and I gave them to him, but two weeks have passed and he doesn't answer me, that's why I had to open a publication here.
This is a part of what the console say:
(index):109 [Violation] Avoid using document.write(). https://developers.google.com/web/updat ... ment-write
rt_js_code @ (index):109
(anonymous) @ (index):111
[Violation] Forced reflow while executing JavaScript took 44ms.
I cannot use the standard code ( include php) because my site uses a cache system and incoming traffic is not counted, I must necessarily use its javascript code. Any suggestion would be welcome.
I wrote all this to one of his boys through ICQ, he asked me for more details and I gave them to him, but two weeks have passed and he doesn't answer me, that's why I had to open a publication here.
This is a part of what the console say:
(index):109 [Violation] Avoid using document.write(). https://developers.google.com/web/updat ... ment-write
rt_js_code @ (index):109
(anonymous) @ (index):111
[Violation] Forced reflow while executing JavaScript took 44ms.
I cannot use the standard code ( include php) because my site uses a cache system and incoming traffic is not counted, I must necessarily use its javascript code. Any suggestion would be welcome.