js 弹窗加载action时 没有数据且弹窗自动关闭这么回事,该怎么解决
js 弹窗加载action时 没有数据且弹窗自动关闭这么回事
点击按钮以后 弹框一闪而过,并且页面原有的数据都没有了(进入假死状态)
<script>
function show(tag){
location.href = "index.action";
var light=document.getElementById(tag);
var fade=document.getElementById('fade');
light.style.display='block';
fade.style.display='block';
}
function hide(tag){
var light=document.getElementById(tag);
var fade=document.getElementById('fade');
light.style.display='none';
fade.style.display='none';
}
</script>
调用弹窗的按钮
<div class="right_add">
<button type="submit" class="btn" href="javascript:void(0)" onclick="show('light')">添加</button>
</div>
弹窗代码
<div id="light" class="white_content">
<div class="close"><a href="javascript:void(0)" onclick="hide('light')"> 关闭</a></div>
<label>
<input type="checkbox" name="routePoints" value=#point.patrolPointId id="path_post_0">
<s:property value="#point.patrolPointName" />
</label>
</div>
------解决思路----------------------
location.href = "index.action";
这里直接跳转了
------解决思路----------------------
页面跳转了,原页面的数据当然也跟着没了
点击按钮以后 弹框一闪而过,并且页面原有的数据都没有了(进入假死状态)
<script>
function show(tag){
location.href = "index.action";
var light=document.getElementById(tag);
var fade=document.getElementById('fade');
light.style.display='block';
fade.style.display='block';
}
function hide(tag){
var light=document.getElementById(tag);
var fade=document.getElementById('fade');
light.style.display='none';
fade.style.display='none';
}
</script>
调用弹窗的按钮
<div class="right_add">
<button type="submit" class="btn" href="javascript:void(0)" onclick="show('light')">添加</button>
</div>
弹窗代码
<div id="light" class="white_content">
<div class="close"><a href="javascript:void(0)" onclick="hide('light')"> 关闭</a></div>
<label>
<input type="checkbox" name="routePoints" value=#point.patrolPointId id="path_post_0">
<s:property value="#point.patrolPointName" />
</label>
</div>
------解决思路----------------------
location.href = "index.action";
这里直接跳转了
------解决思路----------------------
页面跳转了,原页面的数据当然也跟着没了