Hi all, Please tell me how to run a html file (having scripts "<script type="text/javascript">" ) in webview? i have a app.js file, code is here
var window = Titanium.UI.createWindow({backgroundColor:'white'}); var MyView = Ti.UI.createWebView({ top:'0%', width:'100%', height:'100%',url:'MyHtml.html' }); window.add(MyView); window.open();and html file have simple html code and some google chart api calls inside
<script type="text/javascript"> </script>But webview is showing nothing.. It should show the html file with image of chart.
2 Answers
a)Try 'http://www.google.com' in url place see if it displays.If this works b)Create the HTML file in regular file system and run the .htm/.html file see your graph works shows up. if this works, c)then place the file in resources folder and use the url again and see.
You did not put any thing in the script TAG and nothing there, so it would not display any thing. Try using simple <DIV>Testing only</div> under body. You will have to use the correct structure as well HTML, HEADER, SCRIPT AND BODY. Take any simple static html of a simple website's page content and use that to start with.
Checkout this google.charts
Your Answer
Think you can help? Login to answer this question!