0

I am building a mobile website using google's material design resources(sidebar, header, etc). The problem is that I have to load the entire template every time I load a new html file, which means that I need to include the sidebar, header, and so on every html file. I would like to load only the main tag content instead.

Any idea of the best way to do this? I am actually using only jquery, but I am not discarding to use another library.

Angherq
  • 53
  • 5
  • Use ajax. Load content from other pages in the main div. have a look at $.post, $.get and $.ajax – Lelio Faieta May 09 '16 at 18:37
  • Thanks Lelio. I am avoiding this because html content is pretty large to do a jquery append() or html(). I would like to do it in a "cleaner" way. – Angherq May 09 '16 at 18:49
  • You can use iframes. – William B May 09 '16 at 18:56
  • Sorry but you are wrong. Ajax can handle large amount of data. I am not speaking about append. Just fyi... You are loading just a subset of the entire page. How much time does it take to load the entire page? Anyway feel free to use a different way from almost all the websites around... – Lelio Faieta May 09 '16 at 19:04

0 Answers0