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

Re: Use external libraries in XS Engine

$
0
0

UPDATE:

The error I reported below was in my js code. Not sure where, but doesn't appear to be an "XS issue".

 

For others looking at this thread, below is a more detailed example for your reference.

 

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

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;

     }

};

 

 

ORIGINAL:

I'm getting the following error:

 

Found the following errors:

===========================

TypeError: "xml2json" is read-only (line 146 position 0 in /sales/xml2json.xsjslib)

 

here is my import code:

 

$.import("sales","xml2json");

 

xsjslib and xsjs are in the same package, sales, as shown below.

 

Content

-Sales

--ccw.xsjs

--xml2json.xsjslib


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>