[TIMOB-1218] Ti/Titanium in webviews
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T02:46:54.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | fireevent, ti, titanium, webview |
Reporter | wallneradam |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:46:53.000+0000 |
Updated | 2017-03-09T21:24:44.000+0000 |
Description
I have the following codes:
app.js:
var w = Ti.UI.createWindow();
Ti.App.addEventListener('testEvent', function(e) {
Ti.Api.info('testEvent');
});
wv = Ti.UI.createWebView({
html: '<html><head><script type="text/javascript" src="/local.js"></script></head><body><a id="t" onclick="webFunc();" href="#" >click</a></body>'
});
w.add(wv);
w.open();
local.js:
function webFunc(){
document.getElementById('t').innerHTML = 'click2';
Titanium.App.fireEvent('testEvent');
}
TestEvent will never occur, while the link is become 'click2'.
This technique worked in 1.2.0 maybe 1.3.0 (I can't test it now).
Sorry, it was my fault. It is not a bug, only misspelled Ti.API as Ti.Api...
Closing ticket as invalid.