1

This is a general Question:

Consider a plain-html page that hast got some elements which can (if the browser supports) be enhanced by javascript. To do so, javascript needs some additional data, e.g. for relation between displayed entities on the plan-html page.

So my question: To get the additional data, should i make an additional xhr-request oder should i put a script-tag at the bottom of my page, where all the data ist already present in javascript code?

1 Answer 1

2

Have it in a script tag at the bottom of the page if you can. It's much faster and less strain on your server since you don't have to make an additional request every time. Might increase the page size a bit if there is a LOT of data though

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.