Two solutions to the problem that HTML 5 does not support frameset

Time:2021-3-2

The solution is as follows:

The first kind

However, there are fewer and fewer people using iframe at present, and there are incompatibilities between different browsers. And some of my research and development personnel said that it seems very troublesome to transfer values between iframe windows.

The second kind

Use the onload method of jQuery to load the page. However, after jumping to multiple pages, it is invalid to click back and forward on the top of the browser. However, it can be considered as adding a return button.

So individuals prefer this approach.

I usually write like this

$("#main").load("mainIndex.html",function(){

 });

For the page, div + CSS can achieve the effect of frame

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
< title > div + CSS to achieve frameset effect
<style type="text/css">
.header{border-bottom:1px solid #ccc;margin-bottom:5px;}
.MainContainer{min-width:960px;max-width:1600px;}
.sidebar{width:180px;float:left;margin-right:-180px;border-right:1px solid #ccc;min-height:500px;padding:5px;}
.main{float:left;margin-left:200px;padding:5px;}
.content{padding:0 10px;}
</style>
</head>
<body>
    <div class="page">
        <div class="header">
            <div id="title">
                <h1>Top</h1>
            </div>
        </div>
        <div class="MainContainer">
            <div class="sidebar">
            sidebar 
            </div>
            <div  id="main" class="main">
                content
            </div>           
        </div>
    </div>
</body>
</html>

summary

The above is the whole content of this article, I hope the content of this article can bring some help to your study or work, if you have any questions, you can leave a message to exchange.

Recommended Today

Rust and python: why rust can replace Python

In this guide, we compare the rust and python programming languages. We will discuss the applicable use cases in each case, review the advantages and disadvantages of using rust and python, and explain why rust might replace python. I will introduce the following: What is rust? What is Python? When to use rust When to […]