Developer Center

JavaScript Library

Saber uses the Datasilk Core JS library used for UI functionality along with Selector, a jQuery replacement library that weighs in at 5kb (gzipped). This documentation is focused on giving developers information on core features of Saber's JavaScript libraries. You can learn more in-depth knowledge about these two libraries by following the links above.


Loading Script Files

When building your vendor plugin for Saber, there are various ways to load your JavaScript files into the web browser.


S.ajax.post

This function is used to call web APIs (IVendorService) and includes both OnComplete and OnError callback arguments.

S.ajax.post('ShoppingCart/AddToCart', {productId: id}, (response) => { //process response }, (err) => {//process error});