Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: Third Party Javascript In XS Engine?

$
0
0

UPDATE: js file must have extension .xsjslib (from Thomas Jung)

 

Use external libraries in XS Engine

 

 

Should look like this:

 

 

/////////////////////////////////////////////

STRUCTURE:

 

-Content

--MyPackage

---MyApp.xsjs

---MyLib.xsjslib

 

//////////////////////////////////////////////

MyApp.xsjs code:

 

$.import("MyPackage","MyLib");

var x = $.MyPackage.MyLib.MyObject.MyFunction("my test string");

$.response.setBody(x);

 

///////////////////////////////////////////////

MyLib.xsjslib code:

 

var MyObject:{

     MyFunction: function (myString) {

          return = "You passed in the string: " + myString;

     }

};


Viewing all articles
Browse latest Browse all 9164

Trending Articles