View Full Version : sencha + HTML - opening locally on iphone

18 Dec 2010, 11:10 AM

I have a simple sample web page using sencha with 3 buttons. If I publish this through IIS on my local PC, I am able to view the page correctly from my iPhone and Safari via http://localhost/sencha/myexample/index.html. The touch API works very well here.

Now I downloaded all the files to a folder on my iPhone. I changed the paths for the CSS and js so all files are in a single folder.

Using iFile for the iPhone, I am able to select the index.html and view the page in its internal viewer. Here also it displays the touch buttons and works correctly.

However when I try to open the same html from the folder on my iPhone from Safari, it first refused to open local files. After I applied the fix from Cydia, it will now open the html file as long as it is not called INDEX.html.

So I am now able to load the html file in mobile Safari. I can also view the images from this folder I downloaded to.

BUT for the HTML page, it appears to ignore the sencha js and just displays a blank page, with no buttons.

Obviously the page code is correct since it displays and works properly in iFile's viewer. But the same file, in Mobile Safari, displays nothing, as though the JS files are not running and therefore not creating any code for the DOM body.

Any idea why this would be? My iPhone has been released from Jail, which is how I have access to the file system.

20 Dec 2010, 1:45 PM
1. Do you have Apache setup on the iPhone?
2. What are your motivations for doing this in the first place?

17 Jan 2011, 11:24 PM
1. no. Why would I need a web server to open a file locally?

2. The reason is I want to store my files - html, js and css in a local folder and access them in mobile Safari from there instead of using a web server.

18 Jan 2011, 9:02 AM
This isn't really something you can do with the stock iPhone without jailbreaking it, so there may be no one here with the knowledge to answer your question. I certainly don't have it! (Still trying to get may stupid 4.0 jailbroken 3G upgraded to ANYTHING higher so it's not so amazingly slow.)

But I can tell you that the Atomic browser allows you to easily save webpages locally. I'm not sure if it will execute javascript but it might be worth a shot if you don't get any other helpful replies. Good luck!

18 Jan 2011, 10:33 AM
Go check out this online book:


And look at chapter 6, "Going Offline".