1

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?

1 Answer 1

4

You can use an Iframe :

<iframe src="file.txt"></iframe>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.