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



May 25, 2011, 7:24 AM
14 Posts

How to add a serverside JavaScript Lib from another db to an Xpage?

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: xpages,SSJS,resource
  • Replies: 4
 Hi there,
 
I was wondering how to add a serverside JavaScript Library from one application to an XPage in another application. If I want to add a jss lib to an XPage I have two options:
  1. Use JavaScript library from this application
  2. Link to JavaScript library from a URL:
For the second option I can choose between client- and serverside JavaScript and I have to type in a URL of my lib. So I tried this URL: http://localhost/projects/test/testB.nsf/testB.jss. In my case the server runs local. testB.nsf is the application that contains the testB.jss library.
 
By loading my Xpage I get this error message: 
 
Error while executing JavaScript computed expression
 
JavaScript library http://localhost/projects/test/testB.nsf/testB.jss is not available
 
My question is: How to use the option of providing a URL to load a serverside JavaScript library?
 
Thx for helping me. 
Jan 
May 25, 2011, 10:50 AM
54 Posts
Re: How to add a serverside JavaScript Lib from another db to an Xpage?
By "local" do you mean a local database in your data directory or a local server?
Does this same happen in server aswell? Is the JS library accessible to anonymous users? 
 

May 25, 2011, 11:16 AM
14 Posts
Re: How to add a serverside JavaScript Lib from another db to an Xpage?
 By local I mean a domino server running on my local machine. It is a test environment so all have manager rights to the databases. 
 
If I try this with a client side java script library it works fine:
 
<xp:this.resources>
<xp:script src="http://localhost/projects/test/testB.nsf/testclient"
clientSide="true">
</xp:script>
</xp:this.resources>
 
but with the same database and a server side javascript it dosn't work 
 
<xp:this.resources>
<xp:script src="http://localhost/projects/test/testB.nsf/testB.jss"
clientSide="false">
</xp:script>
</xp:this.resources>
 
I tried different URL's one time with  with a file extension .jss one time w/o file extension
 
http://localhost/projects/test/testB.nsf/testB.jss and http://localhost/projects/test/testB.nsf/testB
 
but no success. I always get this error, that the javasript library is not available.
 
 
Jun 6, 2011, 7:12 AM
14 Posts
Re: I have never seen this work for SSJS...
I guess there is no chance to realize that. You have to use design templates for this. But it would be great to get this working.

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