PDA

View Full Version : cWebHTMLBox



FrankValcarcel
14-Mar-2014, 07:04 AM
We are experimenting with the cWebHTML box. The sample in the doc shows how a link can return data to the WebApp.

1. Is there any other way to get data back from the cWebHTML box.

2. Can we create a cWebButton, add a JavaScript function to is that it interrogates the JavaScript in the cWebHTMLBox when clicked and returns a string?

Thanks

chuckatkinson
14-Mar-2014, 07:08 AM
I read some where or heard it that you cannot run JS in a cWebHTML box?

Maybe I'm wrong ???

Mike Peat
14-Mar-2014, 07:18 AM
Chuck & Frank - you can't put JavaScript into your HtmlBox, but you can put JavaScript scripts into your main page (Index.html or whatever) which are able to reference the HTML elements in the box (the usual approach is to give the ones you are going to be interested in ID attributes then the JS can use document.getElementById(theIdYouGaveit") to get references to them and do stuff with them using those.

Mike

chuckatkinson
14-Mar-2014, 07:46 AM
Thanks Mike - that's what I really meant to say. Placing JS inside the HTMLBox doesn't work. But JS in the index.htm is the way to go.

FrankValcarcel
14-Mar-2014, 12:39 PM
Just tested. javaScript runs just fine.

FrankValcarcel
14-Mar-2014, 12:40 PM
Just tested. javaScript runs just fine. OK, loaded in index.js
fv

Harm Wibier
17-Mar-2014, 05:37 AM
There where browser specific issues with putting <script tags inside html boxes. Using JavaScript in event handlers like <button onclick="jsFunction()" works properly as far as I know.