Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

evaljs which contains jquery doesn't work on android

$
0
0

Application type: mobile Titanium SDK: version number, build date and build hash, copied and pasted from the console at application launch Platform & version: Android 4.3 Device: Android emulator Host Operating System: OSX 10.8 Titanium Studio: build: 3.1.2.201308091617 Build: jenkins-titanium-rcp-master-482 (origin/master) Date: 09 August 2013, 16:20:52

a simple test case:

controller.js

var webview = Titanium.UI.createWebView({
        url : 'http://www.amazon.com/gp/aw/rd.html/ref=me_amb_384912601_1/187-9552901-2034115?aid=aw_gw&apid=384912601&arc=1201&arid=1GJE1MJ0PKEKZ0QFSRHB&asn=center-46&at=&force-full-site=1&lc=plm&url=%2Fgp%2Fhomepage.html'
    });
    var window = Titanium.UI.createWindow({
        title : L('newWindow'),
        backgroundColor : 'white'
    });
    window.add(webview);
    webview.addEventListener("load", function() {
        // resourcesDirectory is actually the default location, so the first
        // argument could be omitted here.
        file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "amazon_lib.js"); //amazon_lib.js is inside my assets folder.
        var blob = file.read();
        var readText = blob.text;
        // dispose of file handle & blob.
        file = null;
        blob = null;
        var code1 = readText;
        webview.evalJS(code1);
    });
amazon_lib.js
//<<...jquery.js code here...>>
alert("jquery.js loaded");
Expect Result: Show alert dialog

Actual result: No alert dialog

More Info: Titanium studios console shows this info maybe interesting:

[DEBUG][TilesManager( 1972)] Starting TG #0, 0xb9b34ee0
[DEBUG][WebKit  ( 1972)] ERROR: 
[DEBUG][WebKit  ( 1972)] WebKit does not yet implement getComputedStyle for 'margin'.
[DEBUG][WebKit  ( 1972)] 
[DEBUG][WebKit  ( 1972)] external/webkit/Source/WebCore/css/CSSComputedStyleDeclaration.cpp(800) : void WebCore::logUnimplementedPropertyID(int)
[DEBUG][skia    ( 1972)] --- SkImageDecoder::Factory returned null
...
And. it shows alert when put the alert("jquery.js loaded") to the first line of amazon_lib.js

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>