The question is a bit theoretical.
Suppose I have a local image file that is loaded once in html and could be used in script. For this I write one line:<img id="myImage" src="myImage.png"/>
Now suppose I want to do the same but with text. I have a local .txt file. It seems to be an overdo to make an http request for such a simple purpose!
Using script with var = "my text here" seems like a dirty solution, besides the text should be edited in this case.
Is there a way to simplify that? And if not is there an architectural explanation?