0
votes

I have a Titanium project and I'm trying to load the file index.html located here

-root
----build
----modules
----platform
----Resources
------index.html

With the following code:

var htmlFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "index.html");

And I get the error

The webpage at file:///android_asset/Resources/ could not be loaded because:
net::ERR_FILE_NOT_FOUND

So I'm wondering where should I put the index.html file? Do I have to create a new folder somewhere?

1

1 Answers

0
votes

Hi i had the same problem and my solution is:

-app
---assets
**-----first.html** --> this is my local html page to call
---controllers
---styles
---views

in the

-app
---views
-----index.xml i am calling the local html like: 

<Alloy>
    <Window class="mainWin">
        <WebView id='indexView' url='/first.html' />
    </Window>
</Alloy>

I hope this helps