Titanium Community Questions & Answer Archive

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

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 index.html in the below syntax.

var win1 = Titanium.UI.createWindow({
url:'index.html',
title:'Tab 1',
backgroundColor:'#fff'
});

After launched the application,runtime error will displayed.

Error

Location:[0,0]app://index.html

Message:Reference Error:"XML" is not defined.

Please find me solution to solve the problem.

Thanks and Regards, Venkatesan.R

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

1 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.