Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to load a html page inside another web page using Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 977
    Comment on it

    If you have two html pages and you need to load one inside of another then using Javascript you can easily perform this action by 'load' syntax: Lets consider two pages one.html and second.html

    one.html will go like this

    <html> 
      <head> 
        <script src="jquery.js"></script> 
        <script> 
        $(function(){
          $("#includedContent").load("second.html"); 
        });
        </script> 
      </head> 
    
      <body> 
         <div id="includedContent"></div>
      </body> 
    </html>
    

    and second.html can have any content

    <p>This is your content of another html file </p>
    

    And do not forgot to include the js file.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: