尝试在服务器上部署Qlik Sense mashup时Qlik.js中未捕获的TypeError

时间:2017-06-08 14:20:44

标签: javascript html qliksense mashup

我有以下用于Qlik Sense mashup的HTML代码。此代码在我的本地计算机上运行完美,但每当我在服务器上部署此代码时都会抛出错误。我从JavaScript获得“未捕获的TypeError”,如下所示:

enter image description here

以下是我的HTML代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
  <title>Search Example - Simple</title>
<link rel="stylesheet" href="https://branch.qlik.com/anon/resources/assets/client/client.css">
<link rel="stylesheet" href="sense-search.css"/>
</head>
<body style="width: 80%; margin: 20px auto; font-family: arial;">
<h2>Search Example - Simple</h2>

<p>
  The Search Input and Search results have been added via HTML.
</p>
<sense-search-input id="myInput" mode="visualizations"></sense-search-input>
<sense-search-results id="myResults"></sense-search-results>
<script type="text/javascript" src="https://branch.qlik.com/anon/resources/assets/external/requirejs/require.js"></script>
<script type="text/javascript" src="sense-search.js"></script>

<script type="text/javascript">
/*  
var config = {
host: window.location.hostname,
prefix: "/",
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config( {
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"
});
*/

var config = {
isSecure: true,
host: "****.abc.com",
port: 443,
prefix: "/"
};
require.config( {
baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"
} );

require( ["js/qlik"], function ( qlik ) {
qlik.setOnError( function ( error ) {
    alert( error.message );
} );

var app = qlik.openApp('8435df1b-0473-4fd9-96b4-a488f051ceff', config);
app.model.waitForOpen.promise.then(function(){
   senseSearch.connectWithCapabilityAPI(app);
});

});
/*
var myInput = new SenseSearchInput("myInput");
document.getElementsByTagName("body")[0].appendChild(myInput.element);
senseSearch.connect(config, function(){
myInput.object.attach();
});
*/
</script>

请帮我解决这个问题。我无法找到出路。

0 个答案:

没有答案