Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm mobilefirst 从远程页面调用wlCommonInit()回调_Ibm Mobilefirst - Fatal编程技术网

Ibm mobilefirst 从远程页面调用wlCommonInit()回调

Ibm mobilefirst 从远程页面调用wlCommonInit()回调,ibm-mobilefirst,Ibm Mobilefirst,我一直在使用Android环境在Worklight 6.2中加载远程页面: <mainFile>http://example.com/worklight.html</mainFile> 但是它仍然没有被调用。当使用IBM Portal时,应用程序的资源必须位于Portal server上,以便应用程序找到它们。您不能混合和匹配应用程序的本地和远程资源 也就是说,您不能使用远程index.html从应用程序加载jquery.js或main.js或任何web资源。它们必须位

我一直在使用Android环境在Worklight 6.2中加载远程页面:

<mainFile>http://example.com/worklight.html</mainFile>

但是它仍然没有被调用。

当使用IBM Portal时,应用程序的资源必须位于Portal server上,以便应用程序找到它们。您不能混合和匹配应用程序的本地和远程资源


也就是说,您不能使用远程index.html从应用程序加载jquery.js或main.js或任何web资源。它们必须位于同一位置-根据“在门户中使用Worklight”说明,位于门户服务器上。

是,但在这种情况下,我正在测试托管在自己域上的非门户页面。我以为会调用
wlCommonInit()
。你知道为什么不是吗?(从local works加载同一个页面很好)不管它是否是门户网站。我理解你的意思,但我认为会调用回调,因为它是在HTML中内联硬编码的。我的问题(可能还不清楚)是:为什么不呢?wlCommonInit是从worklight.js调用的。框架文件。您的概念将不起作用。如果页面是从Worklight内部路径加载的,则该页面有效;否则,如果页面是从外部URL加载的,则该页面无效。Frin我看到的
worklight.js
调用
wlCommonInit()
并创建一个空的
wlCommonInit
,如果它没有定义,但是应该定义函数(内联),即使页面是远程的。这就是我不明白的原因。
<!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>