Adam
Adam

Reputation: 5984

Reference javascript file in domino/html directory on xpage

On xpages it appears that you can add javascript resouces that are installed in the database or from a URL. I'd like to reference a javascript file that's in my domino/html directory on the server without having to write the full URL including domain name in the javascript field on the dialog box.

I can work around this by using ../../ in the src attribute but that means I have to know where in the folder structure my .nsf is, which is less than ideal.

Is is possible to reference the root directory directly? If so how do I do it?

enter image description here

Upvotes: 0

Views: 164

Answers (1)

Marcis
Marcis

Reputation: 66

I use the following.

<xp:script
            src="${context.url.scheme}${'://'}${context.url.host}/script.js"
            clientSide="true"
            type="text/javascript">
</xp:script>

Upvotes: 4

Related Questions