Solved

how to handle javascript whitin notes ?

Posted on 2001-07-23
15
285 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
  • 5
  • 4
  • 3
  • +1
15 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
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
Comment Utility
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
Comment Utility
Hello CRAK <|;-)
0
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 24

Expert Comment

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

Expert Comment

by:zvonko
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
...we will see (said the blind man ;-))
0
 
LVL 1

Author Comment

by:oosterbaan
Comment Utility
Thanks guys
0
 
LVL 10

Expert Comment

by:zvonko
Comment Utility
Bob, thank you for the points ;-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now