[英]It's possible the element in html page's status don't change when I refreshed?
for example, I clicked a button, then the <body>
add a element like a <p>
(maybe more changes), now if I clicked F5, the page will back to the status which is no the <p>
.例如,我点击了一个按钮,然后
<body>
添加了一个像<p>
这样的元素(可能会有更多的变化),现在如果我点击 F5,页面将回到没有<p>
。
Is there a way to keep the <p>
?有没有办法保留
<p>
?
sorry about that my english is poor.很抱歉我的英语很差。
You could use the Javascript LocalStorage API or use a statut code in the url like您可以使用 Javascript LocalStorage API 或在 url 中使用状态代码,例如
http://example.com/yourpage.html?code=1 http://example.com/yourpage.html?code=1
with php you can use this :使用 php 你可以使用这个:
<?php
$statut = $_GET['code'];
if($statut === 1){
$message = 'Your text here';
}
else{
$message = 'another message';
}
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.