-3

I want to know how can we write the below code snippet in a Javascript library:

<SCRIPT FOR="eventlib" EVENT="MyEvent(strTest)">
alert("Uploading files...please wait");
    </SCRIPT>

and also below code snippet:

 <SCRIPT LANGUAGE="JScript">
        function ctrl::ClickEvent(a,b)
        {
            alert("MyWindowControl_ClickEvent");
        }
      </SCRIPT>

I am getting syntax error when I try to write the above snippets in a Javascript LIBRARY.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mujtaba Bhat
  • 27
  • 2
  • 12
  • 1
    Stupid question time: Do you just mean in a .js file? – Phil H Apr 16 '12 at 11:28
  • your code is not even some valid javascript , so unless you are using js in a special context you did not tell us about, your code simply wont work ih a broswer. your script tags are not even valid ... – mpm Apr 16 '12 at 11:34
  • I am writing in a lotus notes JavaScript library i.e. .js file. And can you please enlighten me why it is not valid. These statements are used to capture events trig-erred from a C# user control embedded on a web page. These statements work fine when i use them in a webpage but when i try to write them in a .js file, i get a syntax error. – Mujtaba Bhat Apr 16 '12 at 15:46
  • Check out these links and see what javascript has he used :) http://support.microsoft.com/kb/316516 and http://social.msdn.microsoft.com/Forums/en/clr/thread/8e5823ca-bbea-4bfe-8826-8717ae16ba77...Think before you call something stupid!!! – Mujtaba Bhat Apr 16 '12 at 16:13
  • 1
    @MujtabaBhat, Phil wasn't calling your code stupid. He was calling his own question stupid. It's the same as saying "Forgive me for this stupid question I'm asking." :) – Ken Pespisa Apr 16 '12 at 17:33
  • http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript – aziz punjani Apr 16 '12 at 17:47
  • @PhilH...my apology, I misunderstood your comment!!! – Mujtaba Bhat Apr 17 '12 at 02:57

2 Answers2

0

You can't include the script tags when inserting into a Lotus Notes javascript library. Only functions.

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
0

Instead of writing the Script block, we can write a Javascript function. From the event handler we can call it.

Ramkumar
  • 874
  • 11
  • 27