Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to handle javascript whitin notes ?

Posted on 2001-07-23
15
Medium Priority
?
300 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
Industry Leaders: 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 200 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

604 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