dimanche 2 décembre 2018

Should I load content with JavaScript or HTML?

In my website I have 3 buttons to change the language. I was using document.getElementById("title").innerHTML = "Title" with 3 javascript functions for when one of the buttons are clicked, since it seemed easier to modify and the content was the same anyway. But after adding a few more lines of text, I was wondering If I should do it the HTML way instead, with content sections. It's a bit more messy from my point of view but maybe it's compatible with more browsers or just faster. The JS way seems to be better for less text now that I have more content.

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire