我想了解一下noscript这个标签究竟是怎么用的?哪位高手能具体的讲一讲呀?我做了一个小小的注册系统,里面用JS来检测填写的表单,但我禁止了IE的javascript之后,运行时还是一样执行了JS了,而打开QQ空间就会提示我的JS给禁止了,那为什么我的程序还是执行了JS呢?我想要做的是,当用户的浏览器禁止了JS,我就像Qzone那样提示他开启那项功能,具体是要怎么实现的呢?
<noscript>怎么用啊?

解决方案 »

  1.   

    NOSCRIPT 元素 | noScript 对象--------------------------------------------------------------------------------指定要在不支持脚本的浏览器显示的 HTML。例子参考:http://www.w3school.com.cn/tags/tag_noscript.asp你在哪里禁的?
      

  2.   

    <noscript>标签是这样的:检测浏览器是否支持script,如果不支持则显示标签中的内容。最好把源码贴一下
      

  3.   


    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>新用户注册</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/JavaScript">
    <!--
    function strLength(str){
      var value = escape(str);
      var len=0;
      for(i=0;i<value.length;i++){
        var ch=value.charAt(i);
        if(ch=='%'){
          if( value.charAt(i+1)=='u' ){
            var is_kana = false ;
            if(value.charAt(i+2)=='F' && value.charAt(i+3)=='F'){
              var cd = parseInt(value.charAt(i+4).toString()+value.charAt(i+5).toString(),16);
              if( 0x61 <= cd && cd <= 0x9F )
                is_kana = true ;
            }
            i+=5;
            len++;
            if( is_kana )
              continue;
          }else
            i+=2;
        }
        len++;
      }
      return len;
    }function checkForm()
    {
    var f=document.form1

    if(f.agree.checked==false)
    {
    window.alert("请先阅读并同意服务协议!")
    f.agree.focus();
    return false;
    }
    if(f.nikename.value=="")
    {
    window.alert("请输入您的昵称!");
    f.nikename.focus();
    return false;
    }
    if(strLength(f.nikename.value)<4||strLength(f.nikename.value)>20)
    {
    window.alert("昵称不符合规则,4-20个字符!")
    f.nikename.focus();
    return false;} if(f.username.value=="")
    {
    window.alert("请输入您的用户名!");
    f.username.focus();
    return false;
    }
    if(strLength(f.username.value)<4||strLength(f.username.value)>20)
    {
    window.alert("用户名不符合规则,4-20个字符!")
    f.username.focus();
    return false;}


    if(f.password1.value=="")
    {
    window.alert("请输入您的密码!");
    f.password1.focus();
    return false;
    }
    if(strLength(f.password1.value)<6||strLength(f.nikename.value)>20)
    {
    window.alert("密码不符合规则,6-20个字符!")
    f.password1.focus();
    return false;} if(f.password2.value=="")
    {
    window.alert("请输入您的重复密码!");
    f.password2.focus();
    return false;
    }
    if(f.password2.value!=f.password1.value)
    {
    window.alert("两次输入密码不相符!")
    f.password2.focus();
    return false;
    }

    if(f.question.value!=""&f.answer.value=="")
    {
    window.alert("找回密码答案不能为空!")
    f.answer.focus();
    return false;
    } if(!/\w+@\w+(\.\w+)+/ig.test(f.eMail.value))   
       {alert('邮件地址不对');
    f.eMail.focus();
    return false;}

    if(!f.sex[0].checked&&!f.sex[1].checked){
    alert("请选择性别");
    //f.sex.focus();
    return false;}

    if(f.safecode.value=="")
    {
    alert("请输入验证码!");
    f.safecode.focus();
    return false;
    }

    return true
    }
    //-->
    </script><noscript>你的浏览器不支持JavaScript!</noscript></head><body>
    <form id="form_register" name="form1" method="post" action="register_check.asp">
      <table width="660" border="0" align="center" cellpadding="2" cellspacing="1" id="register_table">
        <tr>
          <td width="14%"><div align="right">昵称:</div></td>
          <td width="31%"><label>
            <input name="nikename" type="text" id="nikename" />
          </label></td>
        </tr>
        <tr>
          <td width="14%"><div align="right">用户名:</div></td>
          <td><label>
            <input name="username" type="text" id="username" />
          </label></td>
        </tr>    <tr>
          <td colspan="2"><label>
            <input type="submit" name="Submit" value="注册" onclick="return checkForm();" />
            <input type="reset" name="Submit2" value="重置" />
          </label></td>
        </tr>
      </table>
    </form><!--#include file="bottom.html"-->
    </body>
    </html>
    代码大概这些,中间有些累赘的我删除了,因为我是用TABLE做的,所以烦请慢慢看了
      

  4.   

    ............
        <tr>
          <td colspan="2"><label>
            <input type="submit" name="Submit" value="注册" onclick="return checkForm();" />
            <input type="reset" name="Submit2" value="重置" />
          </label></td>
        </tr>
      </table>
    </form><!--#include file="bottom.html"-->
    </body>
    </html>======>[code]
        <tr>
          <td colspan="2"><label>
            <input type="submit" name="Submit" value="注册" onclick="return checkForm();" />
            <input type="reset" name="Submit2" value="重置" />
          </label></td>
        </tr>
      </table>
    </form><!--#include file="bottom.html"-->
    </body>
    </html>
    [/code]
      

  5.   

    代码没问题.是你禁的地方不对...除了你JAVA小脚本那里外.
    把IE设置.高级.允许活动内容在我的计算机上的文件中运行的勾去掉试试.
      

  6.   

    ---------------------------------
    这里我的浏览器默认已经没有打勾的了我试着把"安全"---“本地Intranet”里的"Java小程序脚本"和"活动脚本"都关了之后,确实可以了,一点提交就跳到检查页面了,但我里面有不是有一句<noscript>的吗?没有显示出来,那noscript怎么用?怎么可以像QQ空间那样可以提示人??