You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ioannis Charalampidis edited this page Jun 7, 2016
·
3 revisions
Requirements
You need the following node modules:
npm install --save jbb
Code Example
Even though it's not recommended, since it's more heavyweight, you can load a .jbbsrc bundle in the browser or in your node.js project or the browser in the same way you would load a binary bundle.
This time you should use the require("jbb/loader") or the JBB.SourceLoader instead of the require("jbb/decoder") and JBB.BinaryLoader:
// Get a reference to the JBB loadervarJBBLoader=require("jbb/loader");// Add one or more profile loaders needed by the bundleloader.addProfileLoader(require("jbb-profile-name/profile-loader"));// Add one or more source bundles to loadloader.add("bundle_name.jbbsrc");// Load all of them and callback when readyloader.load(function(err,database){// Handle errorsif(err){alert("Loading error: "+err);return;}// Handle your data herevarmy_object=database["bundle_name/resource_name"];});