jquery - load one page into another page -


i have used below code load 1 page another

<body>     <ul>         <li><a id="work" href="">work</a></li>         <li><a id="profile" href="">profile</a></li>     </ul>     <div id="container"></div> <script>     $("#work").click(function(){         event.preventdefault();         $("#container").load("work.html");     }     $("#profile").click(function(){         event.preventdefault();         $("#container").load("profile.html");     } </script>  </body> 

in loaded page want load 3rd page same script not working 3rd page

work.html

<body>     <div id="container">     <button id="btn">click me</button>     </div>     <script>         $("#btn").click(function(){             event.preventdefault();             $("#container").load("thirdpage.html");         }     </scirpt> </body> 

if you've copied code verbatim, work.html contains typo on closing script tag: </scirpt>.

change </script> , you'll fine.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -