验证是否启用了Javascipt

问题描述:

我要验证是否启用了JavaScript

如果禁用,请启用它

如何处理asp.net通过JavaScript

在Advance中感谢

I want verify JavaScript is enabled or not

If disabled so enable it

how to handle using asp.net By JavaScript

thanks in Advance

这应该有效
This should work
<script type="text/javascript">
  document.write("<p>JavaScript is enabled.</p>");
  // whatever code you need to do with Javascript.
</script>

<noscript>
  JavaScript is not enabled or not supported.
  <!-- whatever markup you want to display if scripting is disabled/unavailable -->
</noscript>


在页面末尾,在添加以下代码以检测javascript之前,
At the end of the page,before add following code to detect javascript,
<noscript>
        <div class="n1">
        </div>
        <div class="n2">
            <center>
                <span class="hlight">Enable javascript in your browser to work in this site.</span>
            </center>
        </div>
    </noscript>


这两种解决方案都是了解Java脚本的正确方法,因此无需赘述.

但是启用是不可能的.您只能请求或可以指导如何在其浏览器中启用JavaScript,但您不能通过代码自行启用.
Both solution is right to know about java-script so no need to talk about that.

But in mater of enable that is not possible. u can just request or can guide how to enable JavaScript in their browser but u can not enable it by ur self through code.