<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mashup fails to load qlik.js when embedded in an iframe in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Mashup-fails-to-load-qlik-js-when-embedded-in-an-iframe/m-p/1826870#M68015</link>
    <description>&lt;P&gt;I have a mashup that loads qlik.js in the html head as:&lt;BR /&gt;&amp;lt;script src="../../resources/assets/external/requirejs/require.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;In my js file, I run :&lt;BR /&gt;require(["js/qlik"],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;function (qlik) { . . .rest of code. . ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This all works just great when accessing the Mashup directly in a browser tab.&amp;nbsp; That is, when I punch the Mashup URL directly into an address bar from an external client.&amp;nbsp; However, if I attempt to access the Mashup through an iframe I get the following error:&lt;BR /&gt;&amp;nbsp; "Uncaught SyntaxError: Unexpected token '&amp;lt;'"&lt;BR /&gt;After that, "qlik" is undefined and I cannot make any calls.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On inspection, it appears that the qlik.js resource loads some kind of html file when the Mashup is placed into an iframe.&amp;nbsp; Is there some extra code required on the iframe page to ensure the resources load properly?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;EDIT:&lt;BR /&gt;&amp;nbsp; So it turns out I need to revise the require.config&amp;nbsp; baseURL.&amp;nbsp; We set a certain proxy to access Qlik from our Sharepoint, and the require.config(baseURL...&amp;nbsp; &amp;nbsp;needed to be adjusted to account for this.&amp;nbsp; So instead of&lt;/P&gt;&lt;P&gt;.../resources/assets/external/requirejs/require.js&amp;nbsp; it became&amp;nbsp;&lt;BR /&gt;.../&amp;lt;sharepointproxy&amp;gt;/resources/assets/external/requirejs/require.js&lt;BR /&gt;&lt;BR /&gt;Not sure why it's no problem except in an iframe, but qlik.js is now loading properly.,&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 14:31:16 GMT</pubDate>
    <dc:creator>TresSciuri</dc:creator>
    <dc:date>2021-08-05T14:31:16Z</dc:date>
    <item>
      <title>Mashup fails to load qlik.js when embedded in an iframe</title>
      <link>https://community.qlik.com/t5/App-Development/Mashup-fails-to-load-qlik-js-when-embedded-in-an-iframe/m-p/1826870#M68015</link>
      <description>&lt;P&gt;I have a mashup that loads qlik.js in the html head as:&lt;BR /&gt;&amp;lt;script src="../../resources/assets/external/requirejs/require.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;In my js file, I run :&lt;BR /&gt;require(["js/qlik"],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;function (qlik) { . . .rest of code. . ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This all works just great when accessing the Mashup directly in a browser tab.&amp;nbsp; That is, when I punch the Mashup URL directly into an address bar from an external client.&amp;nbsp; However, if I attempt to access the Mashup through an iframe I get the following error:&lt;BR /&gt;&amp;nbsp; "Uncaught SyntaxError: Unexpected token '&amp;lt;'"&lt;BR /&gt;After that, "qlik" is undefined and I cannot make any calls.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On inspection, it appears that the qlik.js resource loads some kind of html file when the Mashup is placed into an iframe.&amp;nbsp; Is there some extra code required on the iframe page to ensure the resources load properly?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;EDIT:&lt;BR /&gt;&amp;nbsp; So it turns out I need to revise the require.config&amp;nbsp; baseURL.&amp;nbsp; We set a certain proxy to access Qlik from our Sharepoint, and the require.config(baseURL...&amp;nbsp; &amp;nbsp;needed to be adjusted to account for this.&amp;nbsp; So instead of&lt;/P&gt;&lt;P&gt;.../resources/assets/external/requirejs/require.js&amp;nbsp; it became&amp;nbsp;&lt;BR /&gt;.../&amp;lt;sharepointproxy&amp;gt;/resources/assets/external/requirejs/require.js&lt;BR /&gt;&lt;BR /&gt;Not sure why it's no problem except in an iframe, but qlik.js is now loading properly.,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 14:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mashup-fails-to-load-qlik-js-when-embedded-in-an-iframe/m-p/1826870#M68015</guid>
      <dc:creator>TresSciuri</dc:creator>
      <dc:date>2021-08-05T14:31:16Z</dc:date>
    </item>
  </channel>
</rss>

