以下脚本必须放在aspx文件的一部分中? [英] Where part of an aspx file the below script must be put?

查看:76
本文介绍了以下脚本必须放在aspx文件的一部分中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

必须将以下脚本放在aspx文件的一部分中?
我把它放在头上,也放在身体上,但是没用.

Where part of an aspx file the below script must be put?
I put it in head and also in body but didn''t work .

<script language="javascript" type="text/javascript">
    am = "This function is disabled!";
    bV  = parseInt(navigator.appVersion)
    bNS = navigator.appName=="Netscape"
    bIE = navigator.appName=="Microsoft Internet Explorer"

    function nrc()
    {
       if (bIE && (event.button >1)) 
       {
          alert(am);
          return false;
       } 
    }
    document.onmousedown=nrc;
    if(bNS && bV<5) window. önmousedown=nrc;
    </script>



[edit]添加了代码块-OriginalGriff [/edit]



[edit]Code Block added - OriginalGriff[/edit]

推荐答案

它不是太重要,但是我倾向于将Javascript放在一个单独的位置.JS文件或文件的底部.
It''s not too important, but I tend to keep my Javascript all together either in a separate .JS file, or at the bottom of the file.


如OriginalGriff所述,将JavaScript块放在ASPX页中的位置并不重要.您从调用脚本的地方来的代码有问题.

请在您从何处调用JavaScript函数时提及代码.

问候
鲁西
As OriginalGriff mentioned, It''s not important where to put JavaScript block in ASPX page. There is something wrong with code from where you are calling script.

Please mentioned code from where are you calling your JavaScript function.

Regards
Rushi


这篇关于以下脚本必须放在aspx文件的一部分中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆