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

Summary of ten Linux command aliases that can improve efficiency

Preface Engineers working in the Linux environmen...

How to check disk usage in Linux

1. Use the df command to view the overall disk us...

Summary of MySQL database like statement wildcard fuzzy query

MySQL error: Parameter index out of range (1 >...

Implementation code for operating mysql database in golang

Preface Golang provides the database/sql package ...

How to introduce Excel table plug-in into Vue

This article shares the specific code of Vue intr...

Writing High-Quality Code Web Front-End Development Practice Book Excerpts

(P4) Web standards are composed of a series of sta...

Summary of MySQL view principles and usage examples

This article summarizes the principles and usage ...

Share 16 burning flame effect English fonts treasure trove

We live in a visual world and are surrounded by m...

Detailed explanation of JavaScript Proxy object

Table of contents 1. What is Proxy? 2. How to use...

Web Design: Script Materials Reconstruct User Experience

<br />Original text: http://blog.rexsong.com...

Example code for converting html table data to Json format

The javascript function for converting <table&g...

How to install git on linux

1. Introduction Git is a free, open source distri...

Vue Basics Listener Detailed Explanation

Table of contents What is a listener in vue Usage...

MySQL green version setting code and 1067 error details

MySQL green version setting code, and 1067 error ...