Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17441] MobileWeb: Fix HTML5 sample app to avoid application errors when preview in browser

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionWon't Fix
Resolution Date2014-11-26T20:59:51.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sn/a
ComponentsMobileWeb
Labelsqe-3.3.0, usability
ReporterOlga Romero
AssigneeChris Barber
Created2014-07-31T19:04:13.000+0000
Updated2017-03-22T21:40:54.000+0000

Description

Description

Error, when the default HTML5 app is being previewed in browser. It happens with packaged for mobile web app as well.

To reproduce

1. Create a default HTML5-based app 2. Run Mobile Web Preview in Browser

Actual result

[Warning] Invalid CSS property declaration at: * (index.html, line 151)
[Log] [INFO] Appcelerator Titanium 3.3.0 Mobile Web (index.html, line 2437)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (ApplicationWindowPlatform.js, line 0)
[Error] TypeError: 'undefined' is not a function (evaluating 'ApplicationWindowPlatform(self, webView, titleBarOn, drawerOn)')
	ApplicationWindow (undefined, line 90)
[Warning] Invalid CSS property declaration at: * (index.html, line 151)
[Log] [INFO] Appcelerator Titanium 3.3.0 Mobile Web (index.html, line 2437)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found)
	send ([native code], line 0)
	load (index.html, line 1280)
	requireDepClosure (index.html, line 1704)
	req (index.html, line 1705)
	scopedRequire (index.html, line 1162)
	ApplicationWindow
	global code (app.js, line 18)
[Error] TypeError: 'undefined' is not a function (evaluating 'ApplicationWindowPlatform(self, webView, titleBarOn, drawerOn)') (undefined, line 90)
[Warning] Invalid CSS property declaration at: * (index.html, line 146)
[Log] [INFO] Appcelerator Titanium 3.2.3 Mobile Web (index.html, line 2524)
[Error] Viewport argument value "device-width;" for key "width" is invalid, and has been ignored. Note that ';' is not a separator in viewport values. The list should be comma-separated. (index.html, line 12)

Expected result

"TARZAN OF THE APES" HTML file should be loaded

Comments

  1. Ashley Sommer 2014-08-08

    I am having this same issue with 3.3.0.GA, the server gives a 404 error when serving /mobileweb/ui/ApplicationWindowPlatform.js The file exists, but the server does not serve it.
  2. John Dalsgaard 2014-11-26

    Same issue on 3.4.1GA. Any progress? - or workarounds? I would really like to use Titanium to create my mobileweb apps as well. However, the html5 template does note work - and with Alloy (which I would prefer) I cannot find a way to create an control :-(
  3. Chris Barber 2014-11-26

    [~jda] The "HTML5" project template should never be used for a Titanium Mobile Web app. It's intended to be a boilerplate project for HTML5 apps inside a WebView. Doing this for Titanium Mobile Web is like trying to drive a car from the back seat. Not only is it a bad idea, it's also dangerous. Just create a default Alloy app and start hacking. Titanium Mobile Web does not support a lot of stuff and file uploads is one of them.
  4. John Dalsgaard 2014-11-26

    Thanks, Chris. So what you are saying is that I cannot use Titanium for this mobile web app that needs to use an control? I was trying to "hack" my way through a webview - where I can select the file or take a photo - just need to get it to communicat with the "real" mobile web page (which should be do-able via app events according to documentation)... But no success yet. /John
  5. Chris Barber 2014-11-26

    [~jda] In Titanium Mobile Web on a mobile browser, you cannot select a file or take a photo. The mobile browser doesn't support it and Titanium Mobile Web doesn't support it. Titanium Mobile Web doesn't even support the camera (though it should be possible). Furthermore, in Mobile Web, WebViews are just iframes and are subject to cross-domain restrictions. The Titanium bridge will only be inserted if the HTML contents originate from the same identical server as the Mobile Web app. I think we're getting off topic with regards to this Jira ticket. If you'd like to continue a dialogue on file uploads, cameras, WebView communication, etc, please ask a question in the community Q&A and we can help you get things sorted out: http://developer.appcelerator.com/question/ask.
  6. John Dalsgaard 2014-11-26

    Hi Chris, I agree - and I already had created a question in the Q&A ;-) http://developer.appcelerator.com/question/179292/best-practice-for-building-a-mobileweb-app
  7. John Dalsgaard 2014-11-26

    .... the most important thing for me to know in relation to this Jira ticket was that the html5 template was not meant to be used in the way I (and others) anticipated - and therefore, not an easy way to add the html controls directly ;-)
  8. Chris Barber 2014-11-26

    Titanium Mobile Web does not support the "HTML-based Application" template. This template was poorly named. I have created TISTUD-7073 to properly rename it to something else less confusing. You should use any of the other templates to build your Mobile Web app.
  9. John Dalsgaard 2014-11-26

    Agree. Makes sense ;-) ... now I just need to find out how to do this with my Alloy app - as I believe Alloy is the best way to create apps in Titanium.
  10. Lee Morris 2017-03-22

    Closing ticket as "Won't Fix".

JSON Source