Home > Backend Development > PHP Tutorial > javascript - Is it more convenient to use iframe or Ajax in the background?

javascript - Is it more convenient to use iframe or Ajax in the background?

WBOY
Release: 2016-08-04 09:20:33
Original
1211 people have browsed it

I bought several sets of background templates at https://wrapbootstrap.com/ and looked at the structure. They were either ajax-based or purely static.
My project uses yii2, so there is no problem with integrating templates. At first, I wanted to use ajax to load the main part of the page, but I found that it was very difficult to turn pages and submit forms. Later, it was changed to a pure static layout, and the world became quieter. However, when the page was switched back and forth, the screen returned to a white screen, which was the white page jump.
In the past, I always used an iframe to wrap the main. Submit within the main, ajax has all kinds of pressure-free, prompt information, jumps and so on. Now with ajax/html and other methods, even if I submit ajax, it is still inconvenient to jump to prompts and so on.

How did you do it?

Reply content:

I bought several sets of background templates at https://wrapbootstrap.com/ and looked at the structure. They were either ajax-based or purely static.
My project uses yii2, so there is no problem with integrating templates. At first, I wanted to use ajax to load the main part of the page, but I found that it was very slow when turning pages and submitting forms. Later, it was changed to a pure static layout, and the world became quieter. However, when the page was switched back and forth, the screen returned to a white screen, which was the white page jump.
In the past, I always used an iframe to wrap the main. Submit within the main, ajax has all kinds of pressure-free, prompt information, jumps and so on. Now with ajax/html and other methods, even if I submit ajax, it is still inconvenient to jump to prompts and so on.

How did you do it?

Isn’t it easy to set up a wrapbootstrap template for yii2?
I am also using yii2

javascript - Is it more convenient to use iframe or Ajax in the background?

Use Ajax, iframe is not safe.

How to access the backend convenientlyStrong

For form submission, you can use iframe to accept the data returned from the background. You can try it. Pay attention to cross-domain homology issues

Whatever is convenient...but in most cases I still use ajax

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template