Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inserting html code from one page, into another html page

I am a bit new to web based material so please bear with me.

I have two html pages on my local drive. Test1.html and test2.html.

How could I take test2.html's contents and place them into test1.html's body?

I have looked into using w3IncludeHTML(); along with things like jQuery .load()

Test1.html

<!DOCTYPE html>
<html>
    <head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    </head>
    <body>
    <p id="text"></p>

    <script type="text/javascript">
    $('#text').load("test2.html");
    </script>

    </body>
</html>

Test2.html

<ul class='myclass'>
    <li>test li one</li>
    <li>test li two</li>
    <li>test li three</li>
</ul>
like image 618
Brad Avatar asked Jul 21 '26 03:07

Brad


1 Answers

As per our chat:

https://chat.stackoverflow.com/rooms/131606/discussion-between-brandon-and-fred-ii

You need to run this as an admin, since this is a permissions issue under Windows 7.

like image 69
Funk Forty Niner Avatar answered Jul 22 '26 17:07

Funk Forty Niner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!