1 Reply Latest reply on Apr 5, 2018 12:16 PM by Santiago Sanchez

    Embedding in Asp.net causing an error

    Michael Lee

      Hi, so i'm trying to embed the following code into my program

       

           <script type='text/javascript'>                   

              var divElement = document.getElementById('viz1522866633086');

              var vizElement = divElement.getElementsByTagName('object')[0];      

              vizElement.style.width = '100%';

              vizElement.style.height = (divElement.offsetWidth * 0.75) + 'px';                   

              var scriptElement = document.createElement('script');                   

              scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';                   

              vizElement.parentNode.insertBefore(scriptElement, vizElement);               

           </script>

       

      And i'm getting an error with the underlined part. It's telling me "JavaScript runtime error: Unable to get property 'getElementsByTagName' of undefined or null reference".

      I have tried to google this and haven't been able to find a solution. 

       

      This is my div

       

      <div class='tableauPlaceholder' id='viz1522866633086' style='position: relative'>

      <noscript><a href='#'><img alt='Number of Awards Given And Received ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;Aw&#47;AwardsGivenAndSent&#47;Sheet1&#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='AwardsGivenAndSent&#47;Sheet1' />

      <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;Aw&#47;AwardsGivenAndSent&#47;Sheet1&#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> 

       

      And just a side question, if I have multiple sheets I want to show on my web page, is it possible to have more than one viz showing to create a dashboard?