Search code examples
javascripthtmlclient-side-scriptingserver-side-scripting

Is using JavaScript for repetitive HTML bulks good?


Let's say you have a menu that's the same for all pages of a website. Should you use client-side or server-side scripting for that?


Solution

  • I would generate it on the server side and cache it. Why make every browser do some work?

    You can generate/output it with the same response for each page instead of having javascript make extra calls or cause the menu to only appear after the script finished running.