I recently saw a website. The navigation bar is written using the js file document.writeln, and then the body is introduced into the index and the file is introduced at the beginning. I would like to ask everyone, is there any difference between this method and writing tags directly in html?
No difference. This is to facilitate the dynamic generation of p structures.
No difference, right?
There is no difference, but I suspect that if it is written like this, if the file is too long, it may not be fully displayed?
Because document.wirteln will treat the current file, and the current js code is also in this file,
The code is gone, and the execution is still messed up. . . . .
I encountered this situation when using document.wirie during testing before.