Now we would like to embed the JavaScript calls from the
YOC/smartadserver JS SDK in a Webview, here I'm looking for the best
approach.Until now I do this with the help of jQuery and some kind of
listener, which is called every 100 ms. It look at all children (tags)
of the body, what the highest and broadest values are and after that
it calls a Titanium function which tries to adjust (accordingly to the
changes of the ad html) the WebView in the app. It works actually
quite good, but maybe there are other more elegant solutions. I had
seen that there are several JS variables that I could possibly also
check whether there were changes in size or a click event. And i may
not get a feedback of some Ads which open up a new window and also get
a new height and width because of that. So that's why I'm looking for
the ideal variant. Any help or suggestions would be highly
appreciated.
Here are 2 links to the functions that I use:
Here is the function which creates the WebView and the close button:
http://pastie.org/3428595
That's the content of the WebView: http://pastie.org/3428600
Thanks, Marco