我在一个网页有很多小图片,点击小图弹出窗口以显示三无大图,先在<script LANGUAGE="javascript"></script>里定义一个函数如 function openwin1() { window.open ("images/award.gif", "newwindow", "height=400, width=581, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")} 在使用时用onclick事件触发函数,弹出的窗口也没有被上网助手拦截。 You can have a try!
这里贴出代码比较清楚点: --------------------------------------------------------------------------- <script language="javascript"> <!-- //时间采集 var ap_name = navigator.appName; var ap_vinfo = navigator.appVersion; var ap_ver = parseFloat(ap_vinfo.substring(0,ap_vinfo.indexOf('(')));var time_start = new Date(); var clock_start = time_start.getTime(); var dl_ok=false;function init() { if(ap_name=="Netscape" && ap_ver>=3.0) dl_ok=true; return true; }function get_time_spent() { var time_now = new Date(); return((time_now.getTime() - clock_start)/1000); }function show_secs() // show the time user spent on the side { var i_total_secs = Math.round(get_time_spent()); var i_secs_spent = i_total_secs % 60; var i_mins_spent = Math.round((i_total_secs-30)/60); var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent); var s_mins_spent = "" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent); document.fm0.time_spent.value = s_mins_spent + ":" + s_secs_spent; window.setTimeout('show_secs()',1000); } //跳转至处理页面 function endSaveRes (){ var endTime = document.fm0.time_spent.value; window.open("/stat/savetime.php?tusername=<?=getUserID();?>&stime=<? $stime = time(); echo $stime;?>&SelectCourse=<?=$SelectCourse;?>&code=010100&endTime="+endTime,"newWin","scrollbars=0, location=0, statusbars=0, menubars=0, width=200,height=100,revisable=1");}// --> </script> </head> <? //时间采集 ?> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="init(); window.setTimeout('show_secs()',1);" <?if("true" == trim($systemArr[StatShow]) && "" != getUserID()){?> onUnLoad="endSaveRes();" <?}?> > <FORM name="fm0" onSubmit="0"><INPUT type="hidden" name="time_spent" size=7 onFocus="this.blur()"></FORM> <? //时间采集 ?>-------------------------------------------------------------------------------- 后面用列表onClick="submit()"提交,刷新本页,弹出统计窗口,怎么样才能用iframe达到与 与弹出窗口同样的效果?试过了太笨也没搞出来,请大家帮忙看一下吧!谢谢了 |----------------------------------------------| |对大家的任何帮助或建议表示衷心感谢!!! | |----------------------------------------------|
|----------------------------------------------|
|对大家的任何帮助或建议表示衷心感谢!!! |
|----------------------------------------------|
function openwin1()
{ window.open ("images/award.gif", "newwindow", "height=400, width=581, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")}
在使用时用onclick事件触发函数,弹出的窗口也没有被上网助手拦截。
You can have a try!
---------------------------------------------------------------------------
<script language="javascript">
<!-- //时间采集
var ap_name = navigator.appName;
var ap_vinfo = navigator.appVersion;
var ap_ver = parseFloat(ap_vinfo.substring(0,ap_vinfo.indexOf('(')));var time_start = new Date();
var clock_start = time_start.getTime();
var dl_ok=false;function init()
{
if(ap_name=="Netscape" && ap_ver>=3.0)
dl_ok=true;
return true;
}function get_time_spent()
{
var time_now = new Date();
return((time_now.getTime() - clock_start)/1000);
}function show_secs() // show the time user spent on the side
{
var i_total_secs = Math.round(get_time_spent());
var i_secs_spent = i_total_secs % 60;
var i_mins_spent = Math.round((i_total_secs-30)/60);
var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
var s_mins_spent = "" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);
document.fm0.time_spent.value = s_mins_spent + ":" + s_secs_spent;
window.setTimeout('show_secs()',1000);
}
//跳转至处理页面
function endSaveRes (){
var endTime = document.fm0.time_spent.value;
window.open("/stat/savetime.php?tusername=<?=getUserID();?>&stime=<? $stime = time(); echo $stime;?>&SelectCourse=<?=$SelectCourse;?>&code=010100&endTime="+endTime,"newWin","scrollbars=0, location=0, statusbars=0, menubars=0, width=200,height=100,revisable=1");}// -->
</script>
</head>
<?
//时间采集
?>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="init(); window.setTimeout('show_secs()',1);"
<?if("true" == trim($systemArr[StatShow]) && "" != getUserID()){?>
onUnLoad="endSaveRes();"
<?}?>
>
<FORM name="fm0" onSubmit="0"><INPUT type="hidden" name="time_spent" size=7 onFocus="this.blur()"></FORM>
<?
//时间采集
?>--------------------------------------------------------------------------------
后面用列表onClick="submit()"提交,刷新本页,弹出统计窗口,怎么样才能用iframe达到与
与弹出窗口同样的效果?试过了太笨也没搞出来,请大家帮忙看一下吧!谢谢了
|----------------------------------------------|
|对大家的任何帮助或建议表示衷心感谢!!! |
|----------------------------------------------|
function go()
{
form1.target = iframe的名字;
form1.submit();
}
</script>