5 Replies Latest reply on Oct 29, 2019 9:41 AM by Ken Flerlage

    How to load a Viz without an Iframe through JS API

    Troy Walker

      Hello all,

       

      I was wondering if it is possible to load a viz without an iframe using the JS API?

       

      Thanks in advance!

        • 1. Re: How to load a Viz without an Iframe through JS API
          Ken Flerlage

          If you use the "Share" button on a workbook then grab the embed code, it will give you Javascript embed code. No iframes are used. For example.

           

          <div class='tableauPlaceholder' id='viz1572018309308' style='position: relative'><noscript><a href='https:&#47;&#47;www.kenflerlage.com&#47;2019&#47;09&#47;text-analysis.html'><img alt=' ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Te&#47;TextAnalysisStarterKit&#47;00ChartMenu&#47;1_rss.png' style='border: none' /></a></noscript><object class='tableauViz'  style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='TextAnalysisStarterKit&#47;00ChartMenu' /><param name='tabs' value='no' /><param name='toolbar' value='yes' /><param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Te&#47;TextAnalysisStarterKit&#47;00ChartMenu&#47;1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /></object></div>                <script type='text/javascript'>                    var divElement = document.getElementById('viz1572018309308');                    var vizElement = divElement.getElementsByTagName('object')[0];                    vizElement.style.width='1300px';vizElement.style.height='927px';                    var scriptElement = document.createElement('script');                    scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                    vizElement.parentNode.insertBefore(scriptElement, vizElement);                </script>

          • 2. Re: How to load a Viz without an Iframe through JS API
            Troy Walker

            Thanks! I noticed this option and tried it but I notice there is still an iframe generated on the page.

             

            Is there anyway to use this without an iframe being generated?

            • 3. Re: How to load a Viz without an Iframe through JS API
              Ken Flerlage

              Hmmm. Not entirely sure. Where does it show the iframe?

              • 4. Re: How to load a Viz without an Iframe through JS API
                Troy Walker

                When the page loads there's an iframe thats nested in the HTML. There isn't one in the code itself but once it loads on the page there's an iframe thats generated. I'm wondering if it possible to load in a viz without an iframe period.

                 

                Here's a screenshot of the iframe it still shows even after using the embedded code.

                 

                Screen Shot 2019-10-29 at 9.01.55 AM.png

                • 5. Re: How to load a Viz without an Iframe through JS API
                  Ken Flerlage

                  Ah, I see that on my website as well. I'm actually not sure, so let's leave this out there for others to chime in.