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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

c - "error: subscripted value is neither array nor pointer nor vector", but why? -