wfcvn 发表于 2007-4-27 10:57:12

***代码生成***浏览器检测生成器

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
--------------------------------------------------------------------------------

脚本说明:
第一步:把如下代码加入<head>区域中:
<script language="javascript">
<!--
function createcodes(entry)
{
line="<script>version=parseint(navigator.appversion); browser='other'; if (navigator.appname=='netscape'){browser='ns'+version;} if (navigator.appname=='microsoft internet explorer'){browser='msie'+version;} if (navigator.appversion.indexof('msie 3')>0) {browser='msie3';}";
with (document.detectform)
{
if (msie3.value!="") {line=line+"if (browser=='msie3') {window.location='"+msie3.value+"'}";}
if (msie4.value!="") {line=line+"if (browser=='msie4') {window.location='"+msie4.value+"'}";}
if (msie5.value!="") {line=line+"if (browser=='msie5') {window.location='"+msie5.value+"'}";}
if (ns3.value!="") {line=line+"if (browser=='ns3') {window.location='"+ns3.value+"'}";}
if (ns4.value!="") {line=line+"if (browser=='ns4') {window.location='"+ns4.value+"'}";}
if (ns5.value!="") {line=line+"if (browser=='ns5') {window.location='"+ns5.value+"'}";}
if (other.value!="") {line=line+"if (browser=='other') {window.location='"+other.value+"'}";}

}
line=line+"</script>"

entry.code.value=line;
}
//-->
</script>

第二步:把如下代码加入<body>区域中:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" valign="top">
<tr>
    <td colspan=3 bgcolor="#6c6c6c"></td>
</tr>
<tr>
    <td height="3"></td>
    <table align="center">
      <tr>
      <td>
          <form name="detectform">
            <table align="center">
            <tr>
                <td></td>
                <td>
                  <div align="center">
                  <center>
                      <table border="1" width="100%">
                        <tr>
                        <td bgcolor="#ccccdd" colspan="2"width="100%">
                            <p>请输入各项连接
                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#ffffff" colspan=2 align=left> </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#eeeeff" colspan="">browser</td>
                        <td bgcolor="#eeeeff" colspan="">page-url</td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2"> msie
                            3 </font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="msie3" size="25" value="http://www.yahoo.com">
                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2"> msie
                            4 </font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="msie4" size="25" value="http://www.yahoo.com">
                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2"> msie
                            5 </font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="msie5" size="25" value="http://www.yahoo.com">
                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2">netscape
                            3</font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="ns3" size="25" value="http://www.yahoo.com">
                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2">netscape
                            4</font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="ns4" size="25" value="http://www.yahoo.com">
                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2">netscape
                            5</font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="ns5" size="25" value="http://www.yahoo.com">

                        </td>
                        </tr>
                        <tr align="center">
                        <td bgcolor="#e4e4e4" colspan=""><font color="#000000" size="2">other
                            browsers</font></td>
                        <td bgcolor="#e4e4e4" colspan="">
                            <input type="text" name="other" size="25" value="http://www.yahoo.com">
                        </td>
                        </tr>
                        <tr align="center">
                        <td colspan="2" bgcolor="#c0c0c0" align="left">
                           
                              <input
            type="button" value="代码生成" name="b1" onclick="createcodes(this.form)" class="pt9">
                              <br>
                              <input type="reset" value="清除重选" name="b2" class="pt9">
                        </td>
                        </tr>
                      </table>
                  </center>
                  </div>
                </td>
                <td></td>
            </tr>
            </table>
         
            <table align="center">
            <tr>
                <td>
                  <table border="1" align="center">
                  <tr>
                      <td bgcolor="#ccccdd" colspan="2">
                        <p>生成的代码如下:
                      </td>
                  </tr>
                  
                  <tr>
                  <tr>
                      <td bgcolor="#eeeeff">
                        <div align="center">
                        <center>
                            <p>拷贝如下代码</p>
                        </center>
                        </div>
                      </td>
                  </tr>
                  <tr>
                      <td bgcolor="#eeeeee">
                        <div align="center">
                        <center>
                            <p>
                              <textarea name="code" cols="45" rows="20" wrap="physical" class="pt9">选择上面的项目生成代码


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

      










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

http://www.huoyue.com.cn 活跃网,活跃人群的论坛,访问活跃网,将给您带来意想不到的收获,还可以免费为您开论坛,让您免费拥有与朋友、网友交流的论坛。你是年轻人吗?你活跃你就上!
页: [1]
查看完整版本: ***代码生成***浏览器检测生成器