[AC-2854] Android WebView JS injection
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-06-19T02:48:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Gaiar Baimouratov |
Assignee | Tony Guntharp |
Created | 2011-06-08T02:54:09.000+0000 |
Updated | 2016-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");
});
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
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.
The behavior is as expected. See explanation and solution [here](http://developer.appcelerator.com/question/116950/tiappfireevent--webview--api-16-issue#answer-208695)
Closed after 30 days of inactivity.