问题
I have just created the default sample app using Sencha Touch 2 by the command
sencha app create FirstApp D:/Sencha/MyFirstApp all
I tried running the index.html but it keeps showing only the progress bar in my chrome and not the default page.
回答1:
I was facing the same problem, and had to do a lot of research before I got to the solution. I'm using sencha touch 2 and running it on IIS server 7. IIS by default does not serve JSON files. So in my Chrome console IIS was returning a file not found (404). Once I added JSON MIME type, and handler mapping to IIS it all started working perfectly. If You're using IIS too you can follow the following instructions to add mime type and handler mapping for JSON to IIS.
- Open up your IIS manager.
- In the server properties, navigate to Mime Types.
Click
Add
. (for me this was on the right panel in windows 7)- Give File name extension as: .json
- set MIME Type to: application/x-javascript
Go back to server properties.
- Navigate to Handler Mappings
Click
Add a Script Map
- Give request path as: *.json
- Executable as: C:\WINDOWS\system32\inetsrv\asp.dll
- Set name to : JSON
Restart Server and your website, to get it working
Hope this helps :)
回答2:
By default sample applications creates in development or as Sencha names 'microloader' mode. That means you do not load the sencha-touch.js at the startup, but all classes both from your app and from core Ext are loaded async from the sdk folder. To run in microloader mode you have to wire up the local http server. Like xampp or other. After than copy (or better link) your sources to htdocs folder and run app in browser via http://localhost/path/to/you/MyFirstApp
Cheers, Oleg
来源:https://stackoverflow.com/questions/11734405/using-senchatouch-2-keeps-showing-only-the-progress-bar