Error inserting javascript library as resource

Hi - I have a javascript library stored in a resources DB. I am trying to insert this resource into the JSHeader event of a design element in a different DB, but when I try to do so i get the error message ‘Server Error: entry not found in index.’

If I insert the library as resource elsewhere in the page (not in the JSHeader) then it works fine; it also works fine if I copy the library into the database where I want to apply it and insert it into the JSHeader. The ACL of the resource DB is fine, and I have tried with other databases with the same results. Has anyone else experienced this issue? Thanks.

Subject: Error inserting javascript library as resource

Paul:

Are you trying to make the JS file global? If so put it in a js folder within the html directory on your server and then link to it by placing the following code the top of your form.

Let me know if you need more help!

Have a great day!

Subject: RE: Error inserting javascript library as resource

Hi Christopher, thanks for the response. I am trying to make the resource global. There are various ways I could do it; in the past, we’ve always put javascript libraries on pages, called the pages “something.js”, and then constructed a reference to that page in the manner you describe.

The reason I’m trying to do it in the way i mentioned is that domino should generate this code for me - theoretically, if I insert a JS library as a resource into the JSHeader, Domino should add something like:

"

in the head section of the resulting HTML page. It does this fine if the library I’m inserting is in the same database as the design element I want to use; it only causes the problem I mentioned if the library is in a different DB. However, there is nothing in the help to say I cannot do this, and I can insert a stylesheet resource which resides in database ‘A’ into a design element in database ‘B’ with no problems. Any other ideas?

Subject: RE: Error inserting javascript library as resource

Paul:

A couple years ago (using LN 6.5) a co-worker and I set up a Lotus Notes db to act as a “global library” for JavaScript and style sheets but we were unable to get other Lotus Notes db’s to understand how to reference the files in the db. We didn’t give up easily so we tried many different ideas for a couple weeks but did not have any luck. We then put the file in a js folder under the html folder on the server and called it using the <script language=“JavaScript” type=“text/javascript”

src=“/something.js”> tag.

We were excited when version 6 was released and Lotus talked about global css and js files. The difference is, we think of global as one place that many database items can reference. Lotus seems to see global as one place in a database that only those db items reference. At least for the web.

Correct, you can insert items from db A into db B but when trying to display/use on the web it fails correct?

Subject: RE: Error inserting javascript library as resource

Hi Christopher - notes lets me insert a javascript script library from database
A into the JSHeader of a design element in database B as a resource, but won’t
let me save the element; that’s when the entry not found in index error message
happens, so I never get as far as viewing on the web.

I would assume that you cannot insert javascript libraries as resources across
databases, except for the fact that notes i>will] let me insert the
resource elsewhere on the form - it’s only in the JSHeader (where references to
.js libraries obviously should be)that I get the error.