Solved

how to handle javascript whitin notes ?

Posted on 2001-07-23
15
292 Views
Last Modified: 2013-12-18
Hi experts,

I did found a few javascripts I want to use in the databases I'm builing (for web purposes), but I don't know how to "import" those scripts into the application.

The remark with those scripts is saying to:

first - Copy the coding into the HEAD of your HTML document

second - Add the onLoad event handler into the BODY tag

third - Put the last coding into the BODY of your HTML document  

How do I do this in Notes R5 ?

Greetings,

Bob
0
Comment
Question by:oosterbaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
15 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6309814
Create a field called $$HTMLHead a computed for display field and paste all of the head js code (watch quotes).

[<Body onload="make a call to js function">]

Then paste or code all of ur html within the [] like this for eg:

[<input type=button name="xxx" value="yyy" onClick="do something">]


Just use your form as html editor

In R5 you can use pages to hold js code and import it into the script tag. But the above method would be simple to start with.

~Hemanth

0
 
LVL 1

Author Comment

by:oosterbaan
ID: 6310098
Please help me out...

The code that I found starts like this:

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function mklist(n)
{
  this.length=n;
  for (var c=1 ; c <= n ; c++) {
    this[c]=0;
  }
  return this;
}

And ends with this:


    window.clearTimeout(window.config.timer);
    window.config.timer=window.setTimeout('sbprint()',window.config.delay);
  }
}
//  End -->
</script>

What do I need to paste into the $$HTMLHead field ? because when I paste this code, error message's appears.

Do I need to add the [ character somewhere or leave lines out ?

Greetings,

Bob
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6310213
Instead of using $$HTMLHead, paste the code directly into the form like this

[<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function mklist(n)
{
 this.length=n;
 for (var c=1 ; c <= n ; c++) {
   this[c]=0;
 }
 return this;
}

And ends with this:


   window.clearTimeout(window.config.timer);
   window.config.timer=window.setTimeout('sbprint()',window.config.delay);
 }
}
//  End -->
</script>
</HEAD>

<Body onLoad="mklist()">
Any HTML code here....
</Body>
</HTML>]

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:CRAK
ID: 6311379
Hemanth,
Why the $$HTMLhead-field? He's using R5....

All he needs is copy the actual JS-code:

function mklist(n)
{
 this.length=n;
 for (var c=1 ; c <= n ; c++) {
   this[c]=0;
 }
 return this;
}
...
etc.
...
   window.clearTimeout(window.config.timer);
   window.config.timer=window.setTimeout('sbprint()',window.config.delay);
 }
}

and paste it in the JS header-event of a form or page. I agree with you that the $$HTMLhead-field works to -even on R4.x servers-, but this is much easier!
Additional advantages: you dan't have to worry about those quotes and the different colors help to make it readable.


Similar to that: paste "mklist()" (without quotes) in the onLoad event of the forms or pages onLoad-event.

0
 
LVL 10

Accepted Solution

by:
zvonko earned 50 total points
ID: 6311398
Hello Bob,

it seams Heman has overreadn the R5 chars :-)

In R5 you need for JavaScript no passtrough tags like [ and ]
To use JavaScript simply open the form where to embed JavaScript in LotusDesigner.
When form opened AND cursor in forms body, than you can see in design properties window (not the property dialog) a set of attributes like "WebQueryOpen", "WebQuerySave",... and a lot of other attributes.
You need two of them: "JSHeader" and "onLoad". Thery are there, look for them...

Into JSHeader place your "first -CopythecodingintotheHEADofyourHTMLdocument" part, but without "<SCRIPT.." and "</SCRIPT>" lines. This two lines are generated for you by Domino.
Into onLoad place your "second-AddtheonLoadeventhandlerintotheBODYtag" part. Here also extract only the string from quotes and place it in onLoad event. The quotes will be generated by Domino.

The last part, your "third-PutthelastcodingintotheBODYofyourHTMLdocument " part, you have to place into the form. Than you have to mark it as HTML. The best way to mark it as HTML is to select this text in the form and to click on this menue option: Text->PassThruHTML
The selected text get after this selection an inverted color to signal that it is now HTML and not simply text.

That should do the trick.

Good luck,
zvonko

0
 
LVL 10

Expert Comment

by:zvonko
ID: 6311400
Hello CRAK <|;-)
0
 
LVL 13

Expert Comment

by:CRAK
ID: 6311426
Hi zvonko!
I see you're reaching for your "first" T-shirt again? You're going fast!
How much time do you spend on EE anyway?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6312537
True, but I want to keep it simple. And also downward compatibility ;-)
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6314226
You think I do this for this fantasy T-shirts (ha ha ha)...
untill now I got only ONE!!!

How much t-****s do you have CRAK? ;-)

...anyway you are right: I spend too much time here (still I wonder when Heman is sleeping :-))
0
 
LVL 1

Author Comment

by:oosterbaan
ID: 6314832
One more last question,

I have tried zvonko's option with the JS header and Onload attributes, and this is working fine, but is it possible to add more the one javascript into these attributes ?

Greetings,

Bob
0
 
LVL 13

Expert Comment

by:CRAK
ID: 6316217
Sure you can: put every instruction on a new line.
If you want to do it right, close every line with a semi-colon (";").
In fact you could even use the semi-colons, without newline:
alert('statement 1'); alert('statement 2')

If things get complicated you could add new functions in JS Header, and address those in the form events:

JS Header:
function alerts(parm)
{
 alert(parm);
 alert('statement 1');
 alert('statement 2');
}

onLoad:
alerts('1st time');
alerts('2nd time');
0
 
LVL 13

Expert Comment

by:CRAK
ID: 6316235
zvonko,
I got over 5000 pt for notes just about two weeks ago. I'm waiting for the "T-shirt problems" (see "what's new") to get solved now, so I can finally see if it's worth wearing it.
Next target: top 15!?
Pitty this guy "stamp" is still there.... I wonder who's on #16!  ;-))
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6316321
...we will see (said the blind man ;-))
0
 
LVL 1

Author Comment

by:oosterbaan
ID: 6316932
Thanks guys
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6318827
Bob, thank you for the points ;-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question