菜鸟提问!急!!!100分解决几个小问题

Nicholasqpl 2004-11-29 07:52:56
1.如何在检查客户端浏览器,如果不是IE6.0的就弹出alert(....);
2.如何在检查客户端有没有打开ActiveX控制,如果没有就弹出alert(....);
3.如何在检查客户端有没有打开cookies,如果没有就弹出alert(....);
4.最后如果window.open("网站首页.aspx")打不开(也就是说没上网助手给拦截了),就弹出alert(....);


解决马上结帖
...全文
156 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Nicholasqpl 2004-12-03
  • 打赏
  • 举报
回复
高手们再给点答案吧
Nicholasqpl 2004-12-02
  • 打赏
  • 举报
回复
还有没有其他可供参考的呢?
Nicholasqpl 2004-12-01
  • 打赏
  • 举报
回复
up
kingchang2000 2004-11-30
  • 打赏
  • 举报
回复
2 你用new ActivexObject("Word.Application")一下,或是其他什么的ActiveX,比如FSO啊,在try{}catch(e){ if (e.message == "Automation服务器不能自动创建对象") ...}这个方法应该能解决是否打开ActiveX权限了

至于问题4,我给你我的代码,是仿照人家的思想写的:
<!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>
Nicholasqpl 2004-11-30
  • 打赏
  • 举报
回复
还有问题2,4有答案吗??
急!!!
梅雪香 2004-11-29
  • 打赏
  • 举报
回复
var isIesix=window.clientInformation.appVersion.indexOf("6.0");
if(isIesix>0) IE6

Nicholasqpl 2004-11-29
  • 打赏
  • 举报
回复
还有另外两个问题呢?
高手们快来看看
kakalong 2004-11-29
  • 打赏
  • 举报
回复
cookie是一小段由浏览器储存起来帮助识别用户身份的信息。在一个表单中设置和检查cookies的实现需要两个文件来完成。第一个文件为cookie1.html,这个文件需要有一些机理(下面例子的一个按钮)来检查是否有一个cookie存在,然后再重定向至表单网页或者文档下载网页。而第二个文件,即表单网页(cookie2.html),也是和重要的因为你将要在上面使用一点点javascript来设置cookie,这个设置是在提交表单之前做的。下面给出这文件:

第一个文件(cookie1.html)

<html>

<head>

<script language="javascript">

<!--

function cookieredirect(hascookieurl, nocookieurl)

{

var currentcookie = document.cookie;


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文件并点击按钮你就回直接连到文档去。
lienzhu 2004-11-29
  • 打赏
  • 举报
回复
<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>

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧