Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Calling HTML.

Hi,

I have created two html files namely index.html and weblike.html in the resource directory.In the main app.js file i was called the weblike.html in the below syntax.
var tab2 = Titanium.UI.createTab({
icon:'static/weblike.png',
title:'Tab 2',
url:'weblike.html',
window:win2
});

After launched the application, when i clicked the tab 2 the corresponding html file could n't be called.

Please find me solution to solve the problem.

Thanks and Regards,
Venkatesan.R

— asked December 3rd 2010 by venkatesan ramdoss
  • html
0 Comments

1 Answer

  • Accepted Answer

    Hi venkatesan

    You can't set the window URL property to point to an html file. You need to use a webview. For example:

    var win1 = Ti.UI.createWindow({
      title:'Tab 1'
    });
    
    webView = Ti.UI.createWebView({
      url:'index.html',
      backgroundColor:'#fff'
    });
    win1.add(webView);
    win1.open();
    
    — answered December 3rd 2010 by Paul Dowsett
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.