Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
TresSciuri
Contributor
Contributor

Mashup fails to load qlik.js when embedded in an iframe

I have a mashup that loads qlik.js in the html head as:
<script src="../../resources/assets/external/requirejs/require.js"></script>

In my js file, I run :
require(["js/qlik"],
     function (qlik) { . . .rest of code. . ..

 

This all works just great when accessing the Mashup directly in a browser tab.  That is, when I punch the Mashup URL directly into an address bar from an external client.  However, if I attempt to access the Mashup through an iframe I get the following error:
  "Uncaught SyntaxError: Unexpected token '<'"
After that, "qlik" is undefined and I cannot make any calls. 

On inspection, it appears that the qlik.js resource loads some kind of html file when the Mashup is placed into an iframe.  Is there some extra code required on the iframe page to ensure the resources load properly?


EDIT:
  So it turns out I need to revise the require.config  baseURL.  We set a certain proxy to access Qlik from our Sharepoint, and the require.config(baseURL...   needed to be adjusted to account for this.  So instead of

.../resources/assets/external/requirejs/require.js  it became 
.../<sharepointproxy>/resources/assets/external/requirejs/require.js

Not sure why it's no problem except in an iframe, but qlik.js is now loading properly., 

0 Replies