Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2854] Android WebView JS injection

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2011-06-19T02:48:30.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterGaiar Baimouratov
AssigneeTony Guntharp
Created2011-06-08T02:54:09.000+0000
Updated2016-03-08T07:47:47.000+0000

Description

Receiving error: E/Web Console( 304): ReferenceError: Can't find variable: Ti When trying to open webview url:'http://localhost:8080/index3.html' HTML code: Ti.App.addEventListener('playpressed', function(data) { $("
").text('Android play event fired').appendTo("#events"); });

Comments

  1. Paul Dowsett 2011-06-13

    In order for us to progress this issue, please edit your ticket to include a proper [Use-case](http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-CreatingGoodUsecases). To clarify, the script should run without modification when added to a blank app.js. Hence, where is the window created? You should include this, so that the core devs can replicate the behavior in the quickest time. Please ensure you format your ticket using the wiki markup provided. Also, please state the Titanium SDK build date and hash. Thank you
  2. Paul Dowsett 2011-06-19

    This does not work as you expect because the Titanium API is not recognized when embedded in remote HTML web pages. Please see [this Q&A answer](http://developer.appcelerator.com/question/116950/tiappfireevent--webview--api-16-issue#answer-208695) for further explanation.
  3. Paul Dowsett 2011-06-19

    The behavior is as expected. See explanation and solution [here](http://developer.appcelerator.com/question/116950/tiappfireevent--webview--api-16-issue#answer-208695)
  4. Paul Dowsett 2011-08-16

    Closed after 30 days of inactivity.

JSON Source