This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 24, 2011, 12:37 PM
10 Posts

Shared javascript functions

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: End user,Developer
  • Tags:
  • Replies: 2
Hi,
 
I have a function that I use time and again and I want to use it on several controls so I'd rather just define it once and then call so I only need to write it once.  How do I go about doing this?  There seems nowhere on the xpage view to define commonly used javascript functions like you would on a html page.  Just some links would work.
 
Many thanks!
 
:-)
 
Adam.
Jul 25, 2011, 8:00 AM
261 Posts
Re: Shared javascript functions
Hello Adam,
 
First of all you need to create a Script Library (Application -> Code -> Script libraries). When creating one you can choose to use JavaScript (for clientside libraries) or Server JavaScript (for server side functions).
 
You can then add the script library you created to an XPage (or Custom Control) using the "Resources" property.
 
Mark
Jul 27, 2011, 3:22 AM
10 Posts
Re: Shared javascript functions
That's very useful.  Thanks!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal