using SenchaTouch 2 keeps showing only the progress bar

坚强是说给别人听的谎言 提交于 2020-01-15 04:40:34

问题


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.

  1. Open up your IIS manager.
  2. In the server properties, navigate to Mime Types.
  3. 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
  4. Go back to server properties.

  5. Navigate to Handler Mappings
  6. Click Add a Script Map

    • Give request path as: *.json
    • Executable as: C:\WINDOWS\system32\inetsrv\asp.dll
    • Set name to : JSON
  7. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!