<SCRIPT language=JavaScript>
<!--
var userAgent = navigator.userAgent;
var MSIEIndex = userAgent.indexOf("MSIE");
if (userAgent.substring((MSIEIndex + 5),(MSIEIndex + 8))<6.0)
alert("不是IE6.0")
//-->
</SCRIPT>
<!--
var userAgent = navigator.userAgent;
var MSIEIndex = userAgent.indexOf("MSIE");
if (userAgent.substring((MSIEIndex + 5),(MSIEIndex + 8))<6.0)
alert("不是IE6.0")
//-->
</SCRIPT>
解决方案 »
- var 一个字符串,最大的长度能有多长?
- 问个HTML标签操作问题
- JavaScript通过ID获取DIV中的全部链接 在每个link点击时 修改href地址
- js解析java字符串
- JS中有没有调用IE另存为的函数
- 用正则表达式,如何取出http://localhost:8080/a/b/c/d/e/test.jsp中间的字串,除开前头的http://localhost:8080
- 如何删除动态添加的行(在线)
- 如何判断 img 元素是否加载成功???
- 请问go2map网站上的查询页面是怎么实现的
- 关于地址转向问题
- 超难的javascript encode解码,谁能解决?
- 如何向html中控件写html语句
if (currentcookie.indexof("formcomplete=yes") != -1) {window.location = hascookieurl;} else {window.location = nocookieurl;}}// --></script></head><body><form name="docdownload"><input type="button" value="download document"onclick="cookieredirect('doc.html', 'cookie2.html')"></form></body></html>
第二个文件(cookie2.html ) <html><head><script language="javascript"><!--function sendform(objform){cookieexpires = "saturday, 01-jan-03 00:00:00 gmt";document.cookie = "formcomplete=yes; path=/";// objform.submit();}// --></script></head><body><form action="test.html" name="info"><table><tr><td>first name</td><td><input type="text" name="firstname"></td></tr><td>last name</td><td><input type="text" name="lastname"></td></tr><tr><td>address</td><td><input type="text" name="address"></td></tr><tr><td>city</td><td><input type="text" name="city"></td></tr><tr><td>state</td><td><input type="text" name="state"></td></tr><tr><td>zip</td><td><input type="text" name="zip"></td></tr></table><input type="button" value="download document"onclick="sendform(document.testform)"></form></body></html>
下面再给出需要用到的doc.html文件:doc.html <html><body><h3>this is the document</h3></body></html>为了测试一下这个功能,你可以打开cookie1.html并点击中按钮,你将被带到表单网页。如果你回到cookie1.html文件并点击按钮你就回直接连到文档去。
if(isIesix>0) IE6
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>检测被拦截窗口(转录他人程序)</title>
<script language="javascript">
/*
---------------------------------
Description: Check the whether the
pop-up window is
available
---------------------------------
2004/9/1 new program zhj
*/
function OnLoad_WelcomePage()
{
//Error Flag 0:successed 1:failed...
var eF=0; //the first test window to check
var popWin = window.open("","ptest","width = 0,height = 0,left = 5000,top = 5000",true);
// the sencond test window to check
var pW = window.open("","ptest","width = 0,height = 0"); //check whether two window has the same handle.
eF = (pW == popWin) ? 0 : 1; //close two window now...
if (popWin != null){
popWin.close();
pW.close();}
else{
eF = 1;} //if tP = 0 then the pop-up window is not available...
if ( eF == 1 )
return false;
else
return true;
}
</script>
</HEAD>
<body onload="alert(OnLoad_WelcomePage()?'ok,the pop-up window is available':'No,the pop-up window is unavailable');">
</body>
</HTML>