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 27, 2015, 9:14 AM
178 Posts
topic has been resolvedResolved

loading a JS library -> Object not created

  • Category: Other
  • Platform: All
  • Release: 9.0.1
  • Role: Developer
  • Tags: javascript
  • Replies: 5

I am using a JavaScript library to identify swipe gestures.

The documentation describes how to refer to the library. In HTML it should be something as followed:

 

<html>
<head>
<script src="dist/slideout.min.js"></script>
<style>

</head>

This should create the following object:

 

I tried the following approaches in XPages to load the library:

<head>
<script src="dist/slideout.min.js"></script>
<style>

with the library as an imported file.

<xp:this.resources>
        <xp:script src="/slideout.js" clientSide="true"></xp:script>
    </xp:this.resources>

with the library as a client js library (original code imported in the library)

and finally the library code in a script block.

All these three methods seem to fail while the object is not being created.

What should I do to correct this?

 

May 27, 2015, 9:50 AM
298 Posts
What is on the browser console?
Are there any errors thrown in the console of the browser? That would be the first place to look.

Howard
May 27, 2015, 11:33 AM
178 Posts
no errors

no errors in the console. 

 

ofcourse they arise when I try to access the object which is not here.

 

the references are good too, the script is available via firebug

May 27, 2015, 1:38 PM
298 Posts
Does slideout use AMD loading?
If so, there is an incompatibility between AMD and Dojo in XPages. Google that and you will find the workarounds. Howard
May 28, 2015, 6:39 AM
178 Posts
loading a JS library -> Object not created

I am using a JavaScript library to identify swipe gestures.

The documentation describes how to refer to the library. In HTML it should be something as followed:

 

<html>
<head>
<script src="dist/slideout.min.js"></script>
<style>

</head>

This should create the following object:

 

I tried the following approaches in XPages to load the library:

<head>
<script src="dist/slideout.min.js"></script>
<style>

with the library as an imported file.

<xp:this.resources>
        <xp:script src="/slideout.js" clientSide="true"></xp:script>
    </xp:this.resources>

with the library as a client js library (original code imported in the library)

and finally the library code in a script block.

All these three methods seem to fail while the object is not being created.

What should I do to correct this?

 


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