Include Java Script Dokuments
Hi there,
is there a possibility to include .js files ?
I need to use the function round of math.js.
Thanks for help.
Hi there,
is there a possibility to include .js files ?
I need to use the function round of math.js.
Thanks for help.
I think the math module should be already available as part of node.js installation. When I check my Vuforia Studio installation I could find it in folder:
C:\Users\<my_user_name>\Documents\VuforiaStudio\Projects\node_modules\three\src\math\Math.js
I think to access it you need to call some think like Math.round()
In generally it should be possible to use an external module. I think C:\Users\<your_user_name>\Documents\VuforiaStudio\Projects\<your_projectName>\extensions or extensions\js ... could be a good location where you can try to save the additional javaScript library file / I could remember that some time added libraries but could not find such example now. I think you must add also the path to runtimeExtensions.json file
But there is another simple way in JavaScript. So for example you can upload the javaScript file to you resource/Uploaded project directory and load it by JavaScript e.g. :
//---------------START Loading the API-----------------------
$scope.loadMyScript = function() {
$scope.asyncLoadScript("app/resources/Uploaded/myJavaScriptFile.js")
.then(function() {
console.log("myJavaScriptFile.js was loaded successfully" },
function() {
console.log("there something went wrong"");
});
}
//---------------END Loading the API-----------------------
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.