方法1:
<script language="javascript">
function logout() {
var strQuitYwInfo = "确认退出吗?";
if (window.confirm(strQuitYwInfo) == true) {
parent.window.opener = null;
parent.window.open("", "_self");
parent.window.close();
}
}
</script>
方法2:
<script language="javascript">
function logout() {
parent.window.opener = null;
parent.window.open("", "_self");
parent.window.close();
}
</script>

方法3:
show_loading
show_street
function show_complete()
{//初始化列表框
str = this.response;
var arrstr = new Array();
arrstr = str.split(",");
//开始构建新的Select.
$("countryid").length = 0;
$('countryid').options.add(new Option('请选择地区',''));
var j = 0;
for(var i=0;i<arrstr.length;i+=2)
{
j++;
$('countryid').options.add(new Option(arrstr[i+1],arrstr[i]));
if(arrstr[i]==countryid) $('countryid').options[j].selected = true;
}
}
Ajax.Request('include/area_ajax.php',{onComplete:show_complete})

<script language="javascript">
var countryid=0;
function show_complete(){//初始化列表框
str = this.response;
var arrstr = new Array();
arrstr = str.split(",");
//开始构建新的Select.
$("countryid").length = 0;
$('countryid').options.add(new Option('请选择地区',''));
var j = 0;
for(var i=0;i<arrstr.length;i+=2)
{
j++;
$('countryid').options.add(new Option(arrstr[i+1],arrstr[i]));
if(arrstr[i]==countryid) $('countryid').options[j].selected = true;
}
}
var streetid = 0;
function show_street(){//加载商圈数据
str = this.response;
if(str.length>1){
var arrstr = new Array();
arrstr = str.split(",");
//开始构建新的Select.
$("streetid").length = 0;
$('streetid').options.add(new Option('请选择小区/商圈',''));
var j = 0;
for(var i=0;i<arrstr.length;i+=2)
{
j++;
$('streetid').options.add(new Option(arrstr[i+1],arrstr[i]));
if(arrstr[i]==streetid) $('streetid').options[j].selected = true;
}
}else{
$("streetid").length = 0;
$('streetid').options.add(new Option('暂无小区',''));
}
}
function show_loadcountryid(){
Ajax.Request('include/area_ajax.php?countryid='+countryid,{onLoading:show_loading, onComplete:show_street});
}
function show_loading(){
$("streetid").length = 0;
$("streetid").options.add(new Option('数据加载中...',''));
}
$("countryid").length = 0;
$("countryid").options.add(new Option('数据加载中...',''));
Ajax.Request('include/area_ajax.php',{onComplete:show_complete})
if(countryid>0){
window.onload = function(){setTimeout("show_loadcountryid()",100);}
}
function getaddress(v){
if($("streetid").value){
$('address').value = $("streetid").options[v].text;
}else{
$('address').value = '';
}
}
</script>

自由转载,转载请注明: 转载自WEB开发笔记 www.chhua.com

本文链接地址: windows.close()时不弹出对话框(IE6)适用 http://www.chhua.com/web-note31

相关笔记

更多