Div nested html without iframe

Div nested html without iframe
Recently, when doing homework, I needed to nest a page without using an iframe, so I had to nest it in a div using the jquery method.

Copy code
The code is as follows:

<script type="text/javascript">
$(document).ready(function() {
$("#button").click(function() {
$("#content").load("index.jsp");
});
});
</script>

The code is just this much, where #button is the id of a button and content is the div where you want to insert the HTML

And you can't just use $("#button").click(function() {}; because this is before the page is loaded, so you can't find the div you want after the page is loaded, so you have to add $(document).ready(function() {};

Another key point is that many people forget to reference jquery, so you must add <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<<:  HTML+CSS+JS to implement the Don't Step on the Whiteboard game

>>:  SQL implementation of LeetCode (196. Delete duplicate mailboxes)

Recommend

XHTML tutorial, a brief introduction to the basics of XHTML

<br />This article will briefly introduce yo...

Analysis of MySQL user management operation examples

This article describes the MySQL user management ...

The difference between char and varchar in MYSQL

CHAR and VARCHAR types are similar, differing pri...

Solve the problem of docker log mounting

The key is that the local server does not have wr...

Div picture marquee seamless connection implementation code

Copy code The code is as follows: <html> &l...

CSS: visited pseudo-class selector secret memories

Yesterday I wanted to use a:visited to change the...

Use a table to adjust the format of the form controls to make them look better

Because I want to write a web page myself, I am al...

Will css loading cause blocking?

Maybe everyone knows that js execution will block...

How to use javascript to do simple algorithms

Table of contents 1 Question 2 Methods 3 Experime...

Centos7 install mysql5.6.29 shell script

This article shares the shell script of mysql5.6....

Some CSS questions you may be asked during an interview

This article is just to commemorate those CSS que...

js data types and their judgment method examples

js data types Basic data types: number, string, b...