Forum Discussion
cybertech
10 years agoCommunity Member
GetPlayer GetVar in javascript
Hi,
I'm testing some of the javascript features. Using a trigger and calling functions in external javascript file (e.g. "user.js") is working correctly. From within the function I can get the pla...
Jürgen_Schoene_
4 years agoCommunity Member
copy this function in your user.js
document.addEventListener("DOMContentLoaded", function(_event) {
function GetVariable( inVarName ){
if (typeof GetPlayer === "function") {
var value = GetPlayer().GetVar( inVarName );
console.info( "var " + inVarName + ":", value );
} else {
window.setTimeout( function(){ // wait 1 second, try again
GetVariable( inVarName )
}, 1000 );
}
}
GetVariable( "maxPage" );
});
Jürgen