Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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]Code Block added - OriginalGriff[/edit]
Posted
Updated 11-May-11 2:36am
v2

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.
 
Share this answer
 
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900