Do site pages, find a variety of frameworks, but are not ideal, frameset bad control, iframe SEO optimization for the site is not good, has been a headache.
Later learned that you can use JS direct call, this use is the page load JS call, as follows:
$ ("#head"). Load ("head.html"); $ ("#foot"). Load ("foot.html");
But there is a problem, different page calls, then the image of the address how to write it? Of course there are solutions, such as node. JS, which is heard to be used, but not familiar.
Bored, and write their own, you can head, tail does not move, the intermediate content at any time call.
Tested, can be implemented, code attached:
Html:
<body><ul id= "list" ><li><a href= "javascript:void (0)" val= "1" target= "_blank" >11111</a ></li><li><a href= "javascript:void (0)" val= "2" target= "_blank" >22222</a></li> <li><a href= "javascript:void (0)" val= "3" target= "_blank" >33333</a></li><li><a href= "javascript:void (0)" val= "4" target= "_blank" >444444</a></li></ul><div id= "wrap" > </div></body>
Js:
$ (function () {<span style= "White-space:pre" ></span>var load_href;$ ("#list li a"). Click (function () {var val=$ (This). attr ("Val"), Console.log (Val), switch (val) {case "1": load_href= "111"; Break;case "2": load_href= "222"; break;} Console.log (LOAD_HREF); $ ("#wrap"). Load ("page/" +load_href+ ". html")})
Self-test, with a switch, of course, there are many ways to achieve, such as If-else,json.
Records for later inspection.
HTML templates, which are displayed according to the link invocation page