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 - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -