hello,
i use an htmlviewer with justgage.js and raphael-2.1.4.min.js dynamically with htmlviewer. executejavascripte,
this work fine on desktop APP but not on web APP, error is:
Could not execute returned javascript: JustGage is not defined
Source: g1 = new JustGage({id: āg1ā,value: 72,min: 0,max: 100,donut: true,gaugeWidthScale: 0.6,counter: true,hideInnerShadow: true});
html code to constant var htmlsource:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Counter</title>
<meta name="viewport" content="width=device-width">
<style>
.container {
width: 450px;
margin: 0 auto;
text-align: center;
}
.gauge {
width: 450px;
height: 450px;
}
a:link.button,
a:active.button,
a:visited.button,
a:hover.button {
margin: 30px 5px 0 2px;
padding: 7px 13px;
}
</style>
</head>
<body>
<div class="container">
<div id="g1" class="gauge"></div>
<a href="#" id="g1_refresh">Random Refresh</a>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.4/raphael-min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/justgage/1.2.9/justgage.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
g1 = new JustGage({
id: "g1",
value: 72,
min: 0,
max: 100,
donut: true,
gaugeWidthScale: 0.6,
counter: true,
hideInnerShadow: true
});
document.getElementById('g1_refresh').addEventListener('click', function() {
g1.refresh(getRandomInt(0, 100));
});
});
</script>
</body>
</html>
load code on webapp to htmlviewer open method:
me.LoadPage(htmlsource)
action button code to change value on gauge object:
dim strscript as String
strscript="g1 = new JustGage({id: "+chr(34)+"g1"+chr(34)+",value: 72,min: 0,max: 100,donut: true,gaugeWidthScale: 0.6,counter: true,hideInnerShadow: true});"
HTMLViewer1.ExecuteJavaScript (strscript)
thanks to help me if you canā¦