关闭

js使用定时器监听控件状态

285人阅读 评论(0) 收藏 举报
分类:
function whichElement(e)
{
    var targ;
    var path = "<" + currenPath + ">";
    if (SDCARD_STATU_ENABLED != sdCardStatu)
    {
        alert(dj('sd_label_no_sd_card'));
        return;
    }
    if (!e)
    {
        var e=window.event;
    }

    if (e.target)
    {
        targ=e.target;
    }
    else if (e.srcElement)
    {
        targ=e.srcElement;
    }
    if (targ.nodeType==3) // defeat Safari bug
    {
        targ = targ.parentNode;
    }

    if (window.win && (window.win.closed == false))
    {
        window.win.close();
    }
    path = path.replace(/\%/g, "%25");
    path = path.replace(/\ /g, "%20");
    path = path.replace(/\</g, "%3C");
    path = path.replace(/\>/g, "%3E");
    path = path.replace(/\//g, "%2F");
    path = path.replace(/\&/g, "%26");
    path = path.replace(/\=/g, "%3D");
    path = path.replace(/\#/g, "%23");
    var url = 'sd_upload.htm?path='+path;
    win = window.open(url, 'tree', 'scrollbars=yes,resizable=no,width=720,height=480');
    watchChildWin();
    $("#button_upload").attr("disabled", true);
    $("#button_upload").css("color", "#ACA899");
}

function watchChildWin()
{
	try
	{
		if ( null == win.document || (win.closed == true)) //firefox Google Opera
		{
			setControlDisable("button_upload", false);
			$("#button_upload").attr("style", "color:#000000");
		}
		else
		{
			setTimeout("watchChildWin()", 100);
		}
	}
	catch(e) //ie
	{
		setControlDisable("button_upload", false);
		$("#button_upload").attr("style", "color:#000000");
	}
}

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:309544次
    • 积分:8708
    • 等级:
    • 排名:第2263名
    • 原创:1096篇
    • 转载:14篇
    • 译文:0篇
    • 评论:5条
    最新评论