I am developing a site so that it can be accessed offline. I've tried and it worked. But there is a little problem, my content is not structured properly.
Save as myjs.js
var text = '<html> <head> <title> TEST BRO </title> </head> <body> HELLO WORLD </body> </html>';
document.write (text);
On another page, I accessed the script above.
Save as page.html
<script src="myjs.js"></script>
I enable Cache in .htaccess
to make the content accessible offline.
However, in the inspect element, I see that the HEAD
tag is empty, and the TITLE tag is inside BODY
.
How to solve this problem?
I only need JavaScript, not jQuery. Please help me