function save_right_div(domid)
{
Ajax.call('store_design.php?act=set_div&domid='+domid+'&is_column=3','', set_right_result, 'POST', 'JSON');
}function set_right_result(result)
{
document.getElementById("div_html").value='';
if(result==2)
{
alert('数据入库出错');
}
else
{
var scroll_top = document.documentElement.scrollTop;
window.location.href=window.location.href;
window.scrollTo(0,scroll_top);
}
}
解决方案 »
- php 远程连接odbc使用 access
- 复选框如何变为静态不能再被改变
- 语句的效率问题??大家帮忙看看~~
- arsort($a) 的疑問
- 紧急求助!!为什么设置ini_set('max_execution_time', 100), php程序100秒后不会结束??
- 唠叨、神仙等等的高手请帮忙看看SQL
- 在线编辑器选择字体颜色时,选中的字体就会不选中,无法加颜色,怎么办?
- 我建了个JScript基础论坛,热烈欢迎初级用户前来讨论。
- php可以读取别个域下的cookie码?
- 紧急求助各位大鸟:$PHP_SELF为什么不能实现循环显示??
- liux 目录下自动生成文件夹,
- 求:php中自动返回上一步的代码。
window.location.href=window.location.href; // 上面执行完了以后,dom对象重新绘制了,所以下面的内容永远都不会执行 window.scrollTo(0,scroll_top);
window.location.href=window.location.href;
alert(1);//这样可以弹出1
// 因js要执行完毕以后,才移交个浏览器处理window.scrollTo(0,scroll_top); // 这个改变的是当前的window,而不是刷新后的window
可以统计url传参 或者 cookie设置,然刷新后的页面中,重新获取这个参数,然后window.scrollTo(0,scroll_top);设置!var scroll_top = 'scroll_top=([^&\b]+)'.exec(window.location.href);
if(scroll_top) {
document.body.onload = function(){
window.scrollTo(0,scroll_top[1]);
}
}function set_right_result(result)
{
document.getElementById("div_html").value='';
if(result==2)
{
alert('数据入库出错');
}
else
{
var scroll_top = document.documentElement.scrollTop;
var url = window.location.href.repalce(/[&\?]?scroll_top=([^&\b]+)/i, '');
if(url.indexOf('?') !== false) {
url += '&scroll_top=' + scroll_top;
} else {
url += '?scroll_top=' + scroll_top;
}
window.location.href=url;
//window.scrollTo(0,scroll_top);
}
}