How to initialize new DOM contents using javascript and keep previous DOM somewhere else? -


i have 2 pages:

  1. page1.html
  2. page2.html

page1.html :

<html> <head>some css , js goes here</head> <body><a href="page2.html"></a></body> </html> 

page2.html :

<html> <head> few more css , js goes here</head> <body><a href="page3.html"></a></body> </html> 

my plan is: when user clicks on

<a href="page2.html"></a> 

i grab content of page2.html via ajax , store contents of page1.html in javascript variable

now how can insert content of page2.html in dom , initialize $(document).ready events in javascripts of page2.html must triggered.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -