jlmontes@rauroszm.com Posted October 6, 2016 Posted October 6, 2016 Hello, I have uniGUI_Professional_0.99.96.1329. I have one TuniURLFrame with this HTML: <!DOCTYPE html> <html style="height:95%"> <head> <script src="/files/TeeChart/teechart.js" type="text/javascript"></script> <script type="text/javascript"> var Chart1; function draw() { Chart1=new Tee.Chart("canvas"); Chart1.panel.transparent=true; Chart1.walls.back.format.shadow.visible=true; Chart1.title.text=""; Chart1.addSeries(new Tee.Line()).addRandom(1000); resize(Chart1); }; function resize(chart) { if (!chart) return; var canvas = chart.canvas; var w=800; canvas.width=w; canvas.setAttribute('width', ""+w+"px"); var h=800; canvas.height=h; canvas.setAttribute('height', ""+h+"px"); canvas.style.width=""+w+"px"; canvas.style.height=""+h+"px"; chart.bounds.width=w; chart.bounds.height=h; chart.draw(); }; </script> </head> <body onload="draw()" onresize="resize(Chart1)" style="margin:0; padding:0; min-height:100%; height:100%; overflow:hidden"> <br><canvas id="canvas" style="height:400; width:800; align: center;"> </canvas> </body></html> This html works wel. When in the delphi source code execute this command: UniSession.AddJS( 'Chart1.addSeries(new Tee.Line()).addRandom(1000);') I get one error: "Chart1 is not defined" How I can access to Chart1 var?? Thanks Quote
Administrators Farshad Mohajeri Posted October 6, 2016 Administrators Posted October 6, 2016 UrlFrame uses an window which can be considered as a separate browser window. That's why you can not access its elements. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.