Home > Web Front-end > JS Tutorial > jquery iframe refresh page prompt under firefox will cause repetition of previous actions_jquery

jquery iframe refresh page prompt under firefox will cause repetition of previous actions_jquery

WBOY
Release: 2016-05-16 17:46:18
Original
1592 people have browsed it

Refreshing the page will prompt "To display this page, Firefox must send data that will cause the previous action to be repeated (such as searching or placing an order)"
Look at the following code

Copy code The code is as follows:

$("iframe").load(function(){
$(this).attr( "src","about:blank");
})

You can avoid this prompt by setting the address to an empty page after opening the frame
But there is a problem after setting src The load event will be triggered, which will lead to cyclic loading
So you need to set a parameter and make a mark after triggering the normal event
Check it after loading
Copy Code The code is as follows:

$("iframe[name=hi]").load(function(){
if ($(this). data("send")) {
$(this).attr("src", "about:blank").data("send",false);
}
})
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