首 页免费资源建站技术源码下载软件下载精品淘吧客户留言
用户登陆 | 用户注册
您当前的位置:笃志小屋建站技术特效代码技 巧 类 → 文章内容
动生成检测浏览器各种参数的脚本
作者:佚名  来源:不详  发布时间:2007-9-30 9:16:31

动生成检测浏览器各种参数的脚本



<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->

<script>

function go(){
document.forms[1].scriptfield.value="<script>n//BrowserCheck浏览器检测脚本生成器n//luxiaoqing http://www.StSky.Comn"
document.forms[1].scriptfield.value=document.forms[1].scriptfield.value+"if ("+document.forms[0].version.value+"<=parseFloat(navigator.appVersion)){if (navigator.appName.indexOf('"+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+"')!=-1){if (4<=parseFloat(navigator.appVersion)){if ("+document.forms[0].width.value+"<=screen.width){if ("+document.forms[0].height.value+"<=screen.height){if ("+document.forms[0].depth.value+"<=screen.colorDepth){}else{error()}}else{error()}}else{error()}}}else{error()}}else{error()}"
if (document.forms[0].em.options[document.forms[0].em.selectedIndex].value=="popup"){
// document.forms[1].scriptfield.value=document.forms[1].scriptfield.value+'window.alert("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+"版本"+document.forms[0].version.value+'以上。最佳分辨率 '+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix. '+document.forms[0].depth.value+' 位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+",您的显示器属性和颜色数无法检测。")}'
document.forms[1].scriptfield.value=document.forms[1].scriptfield.value+'function error(){if(parseFloat(navigator.appVersion)<4.00){window.alert("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+" "+document.forms[0].version.value+'以上。最佳分辨率 '+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix.'+document.forms[0].depth.value+'位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+",您的显示器属性和颜色数无法检测。")}else{window.alert("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+" "+document.forms[0].version.value+'以上。最佳分辨率 '+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix. '+document.forms[0].depth.value+' 位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+", 分辨率"+screen.width+"x"+screen.height+" and "+screen.colorDepth+" 位色")}}n</sc'+'ript>'}
else{
// document.forms[1].scriptfield.value=document.forms[1].scriptfield.value+'document.write("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+" "+document.forms[0].version.value+'以上。最佳分辨率'+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix.'+document.forms[0].depth.value+' 位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+",您的显示器属性和颜色数无法检测。")}else{error()}}'
// document.forms[1].scriptfield.value=document.forms[1].scriptfield.value+'function error(){document.write("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+" "+document.forms[0].version.value+'以上。最佳分辨率'+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix. '+document.forms[0].depth.value+' 位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+", 分辨率"+screen.width+"x"+screen.height+" and "+screen.colorDepth+" 位色")}n</sc'+'ript>'}
document.forms[1].scriptfield.value=document.forms[1].scriptfield.value+'function error(){if(parseFloat(navigator.appVersion)<4.00){document.write("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+" "+document.forms[0].version.value+' 以上。最佳分辨率'+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix. '+document.forms[0].depth.value+' 位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+",您的显示器属性和颜色数无法检测。")}else{document.write("本站推荐使用 '+document.forms[0].browser.options[document.forms[0].browser.selectedIndex].value+" "+document.forms[0].version.value+' or higher, 分辨率'+document.forms[0].width.value+'x'+document.forms[0].height.value+' pix. '+document.forms[0].depth.value+' 位色。您现在使用 "+navigator.appName+" "+navigator.appVersion+", 分辨率"+screen.width+"x"+screen.height+" and "+screen.colorDepth+" 位色")}}n</sc'+'ript>'}
}
// )}
</script>
<table border="0" width="100"
bgcolor="#9BADB8">
<tr>
<td
style="border-left: 5px groove; border-right: 5 groove; border-top:
5 groove; border-bottom: 5 groove"
align="center" height="646">
<form method="POST">
<table border="0" width="443">
<tr>
<td width="123" align="right"><font color="#000000"
face="Arial"><strong><br>
Browser</strong></font></td>
<td width="310" align="left" valign="bottom"><font color="#000000" face="Arial"><br>
<select name="browser" size="1" style="font-family: MS Sans
Serif, Arial">
<option value="Microsoft Internet Explorer" selected>Microsoft
Internet Explorer</option>
<option value="Netscape">Netscape Navigator</option>
</select>
</font></td>
</tr>
<tr>
<td width="123" align="right"><font color="#000000"
face="Arial"><strong>Browser version</strong></font></td>
<td width="310" align="left"><font face="Arial">
<input
type="text" name="version" size="5"
value="4.0">
</font></td>
</tr>
<tr>
<td width="123" align="right"><font color="#000000"
face="Arial"><strong>Screen width</strong></font></td>
<td width="310" align="left"><font color="#000000"
face="Arial">
<input type="text"
name="width" size="5" value="800">
pixels</font></td>
</tr>
<tr>
<td width="123" align="right"><font color="#000000"
face="Arial"><strong>Screen height</strong></font></td>
<td width="310" align="left"><font color="#000000"
face="Arial">
<input type="text"
name="height" size="5" value="600">
pixels</font></td>
</tr>
<tr>
<td width="123" align="right" valign="top"><font
color="#000000" face="Arial"><strong>Screen depth</strong></font></td>
<td width="310" align="left"><font color="#000000"
face="Arial">
<input type="text"
name="depth" size="5" value="32">
bit <br>
<small><small>(32 bit colors 32 bit, for 16 bit colors 16
bit, for 256 colors 8 bit and for 16 colors 4 bit)</small></small></font></td>
</tr>
<tr>
<td width="123" align="right"><font color="#000000"
face="Arial">代码生成方式</font></td>
<td width="310" align="left"> <font color="#000000" face="Arial">
<select name="em" size="1" class="pt9">
<option value="popup">Alert pop-up message</option>
<option value="doc">Display error line in document</option>
</select>
</font></td>
</tr>
<tr>
<td width="123" align="right"><font face="Arial"></font></td>
<td width="310" align="left"><font color="#000000"
face="Arial">
<input type="button"
value="生成代码" name="make"
onClick="go()" class="pt9">
</font></td>
</tr>
</table>
</form>
<form method="POST">
<table border="0" width="431">
<tr valign="top">
<td width="425" height="363"> 将如下代码加入HTML的<HEAD> 区:
<div
align="center">
<center>
<p><font
color="#000000">
<input type="button" value="选择代码"
name="selectbutton"

onClick="document.forms[1].scriptfield.focus();document.forms[1].scriptfield
.select()" class="pt9">
<br>
<textarea rows="15" name="scriptfield" cols="60"
class="pt9" wrap="VIRTUAL">



2007-9-30 9:16:31免费资源duzhi.net

[ ] [返回上一页] [打 印]

【笃志小屋duzhi.net】

  技术文章导航
  技术文章排行
  精彩推荐
Copyright www.duzhi.net All Right Reserved.
设计制作:翼迅设计室 Equick Desgin Home 在线QQ:303471038
网络备案号:冀ICP备06008201号 站长信箱:webmaster#duzhi.net(将#换为@)
本站部分文章和图片来源于网络和内容提供伙伴,如果侵犯了您的权利,请留言告知,本站定会及时删除相关文件!