Strings with HTML code in Javascript
I am here because I need to reduce the work of a server. But first I have a question: well, a form post consumes recourses of the server, of course, but I have a html form post with a input hidden. It don't saves in the database or something like that, it exist to give some data to other Web page. Also consumes it server's recourses?
Ok, now my question. I want yo change that with something more don't goes to the server and don't consume it recourses. Reduce the quantity of comunications with the server. I want a lot of the work happen in the client computer.
I know there is session storage. I am thinking in that for this (for the information that goes to another Web page). But this is the problem: these hidden sometimes lead HTML files that will be charged in the Web site as part of other files. I thought with session storage would store a lot of this HTML code as string variables, so when I need this code I only call the local variable with the respective HTML.
Well, my question is: can I have this HTML code in local variables of Javascript and specifically in jQuery?? How can I do it, with session storege in jQuery?? Or if not, what do you recommend me for reduce the work in the server and give part of that to the users computer?? If I use javascript posts (with hidden), will go these post also necessarily to the server??