ibm mobilefirst - Calling wlCommonInit() callback from remote page -
i've been loading remote page in worklight 6.2 using android environment:
<mainfile>http://example.com/worklight.html</mainfile>
of course internal main.js
wlcommoninit()
callback not called because worklight can't find path of main.js
javascript file. moved wlcommoninit() callback inline remote html source in way (the following remote page worklight.html
):
<!doctype html> <html> <head> <meta charset="utf-8"> <title>asdapp</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"> <!-- <link rel="shortcut icon" href="images/favicon.png"> <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> --> <link rel="stylesheet" href="css/main.css"> <script>window.$ = window.jquery = wljq;</script> </head> <body > <!--application ui goes here--> simple text <script> var wlinitoptions = {}; if (window.addeventlistener) { window.addeventlistener('load', function() { wl.client.init(wlinitoptions); }, false); } else if (window.attachevent) { window.attachevent('onload', function() { wl.client.init(wlinitoptions); }); } function wlcommoninit() { alert("wlcommoninit()"); } </script> </body> </html>
but it's still not called.
when using ibm portal, resources of application must located on portal server in order application find them. cannot mix & match local , remote resources application.
that is, cannot have remote index.html load jquery.js or main.js or web resource application. must reside in same location - on portal server per "using worklight in portal" instructions.
Comments
Post a Comment