ljl 发表于 2007-4-27 10:34:50

***综合类***检测浏览器各种参数脚本的自动生成器

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果把如下代码加入到<body>区域中

<script>



function go(){

document.forms.scriptfield.value="<script>\n//browsercheck浏览器检测脚本生成器\n//luxiaoqinghttp://www.njcatv.net/javascript/dai3.htm\n"

document.forms.scriptfield.value=document.forms.scriptfield.value+"if ("+document.forms.version.value+"<=parsefloat(navigator.appversion)){if (navigator.appname.indexof('"+document.forms.browser.options.browser.selectedindex].value+"')!=-1){if (4<=parsefloat(navigator.appversion)){if ("+document.forms.width.value+"<=screen.width){if ("+document.forms.height.value+"<=screen.height){if ("+document.forms.depth.value+"<=screen.colordepth){}else{error()}}else{error()}}else{error()}}}else{error()}}else{error()}"

if (document.forms.em.options.em.selectedindex].value=="popup"){

// document.forms.scriptfield.value=document.forms.scriptfield.value+'window.alert("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+"版本"+document.forms.version.value+'以上。最佳分辨率 '+document.forms.width.value+'x'+document.forms.height.value+' pix. '+document.forms.depth.value+' 位色。您现在使用 "+navigator.appname+" "+navigator.appversion+",您的显示器属性和颜色数无法检测。")}'

document.forms.scriptfield.value=document.forms.scriptfield.value+'function error(){if(parsefloat(navigator.appversion)<4.00){window.alert("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+" "+document.forms.version.value+'以上。最佳分辨率 '+document.forms.width.value+'x'+document.forms.height.value+' pix.'+document.forms.depth.value+'位色。您现在使用 "+navigator.appname+" "+navigator.appversion+",您的显示器属性和颜色数无法检测。")}else{window.alert("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+" "+document.forms.version.value+'以上。最佳分辨率 '+document.forms.width.value+'x'+document.forms.height.value+' pix. '+document.forms.depth.value+' 位色。您现在使用 "+navigator.appname+" "+navigator.appversion+", 分辨率"+screen.width+"x"+screen.height+" and "+screen.colordepth+" 位色")}}\n</sc'+'ript>'}

else{

// document.forms.scriptfield.value=document.forms.scriptfield.value+'document.write("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+" "+document.forms.version.value+'以上。最佳分辨率'+document.forms.width.value+'x'+document.forms.height.value+' pix.'+document.forms.depth.value+' 位色。您现在使用 "+navigator.appname+" "+navigator.appversion+",您的显示器属性和颜色数无法检测。")}else{error()}}'

// document.forms.scriptfield.value=document.forms.scriptfield.value+'function error(){document.write("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+" "+document.forms.version.value+'以上。最佳分辨率'+document.forms.width.value+'x'+document.forms.height.value+' pix. '+document.forms.depth.value+' 位色。您现在使用 "+navigator.appname+" "+navigator.appversion+", 分辨率"+screen.width+"x"+screen.height+" and "+screen.colordepth+" 位色")}\n</sc'+'ript>'}

document.forms.scriptfield.value=document.forms.scriptfield.value+'function error(){if(parsefloat(navigator.appversion)<4.00){document.write("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+" "+document.forms.version.value+' 以上。最佳分辨率'+document.forms.width.value+'x'+document.forms.height.value+' pix. '+document.forms.depth.value+' 位色。您现在使用 "+navigator.appname+" "+navigator.appversion+",您的显示器属性和颜色数无法检测。")}else{document.write("本站推荐使用 '+document.forms.browser.options.browser.selectedindex].value+" "+document.forms.version.value+' or higher, 分辨率'+document.forms.width.value+'x'+document.forms.height.value+' pix. '+document.forms.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.scriptfield.focus();document.forms.scriptfield

.select()" class="pt9">

                        <br>

                        <textarea rows="15" name="scriptfield" cols="60"

class="pt9" wrap="virtual">
      










--------------------------------------

拥有三人行论坛管理系列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有千人在线的真实火暴效果,让您不在为论坛因没有人气而留不住会员而烦恼,使您的论坛早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。(您使用的是免费版本,购买收费版本后,将不带广告。业务QQ:247216 44985227)
页: [1]
查看完整版本: ***综合类***检测浏览器各种参数脚本的自动生成器