QBoard » Advanced Visualizations » Viz - Tableau » Getting error while trying to render a view from tableau server using javascript

Getting error while trying to render a view from tableau server using javascript

  • I'm getting the below error while trying to run the javascript code in attempt to render a view from my tableau server which has trusted authentication.

    While trying to run the JS code, the view is not getting rendered in the browser, however, if I log in to my tableau server on one tab and run the JS in another tab, the view is getting rendered as its taking the authentication from the browser cache.

    Error says:

    Refused to display < url> in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

    Code:

    <script type="text/javascript" 
        src="http://<tableau server URL of the view>"></script>
    <script type="text/javascript">
        function initViz() {
            var containerDiv = document.getElementById("vizContainer"),
                url = "<Tableau server URL of the view>",
                options = {
                    hideTabs: true,
                    onFirstInteractive: function () {
                        console.log("Run this code when the viz has finished loading.");
                    }
                };
            var viz = new tableau.Viz(containerDiv , url);
            }​
      August 11, 2021 1:47 PM IST
    0
  • You have to go to browser settings and allow third-party cookies. Tableau explicitly says that in the documentation.
      September 4, 2021 12:35 PM IST
    0
  • It's resolved. Had to do some changes in the tableau server configuration. Disabled clickjacking and it worked.

    Thanks everyone, esp @anoop :)

    Cheers!

      October 21, 2021 2:34 PM IST
    0
  • I had the same issue and I fixed it without disabling clickjacking.!

    Here is what i did:

    If you do not want to disable Clickjacking then,

    instead of using the browser url of your tableau view,

    use the link (yes! i am talking about a URL not the embed code) provided by tableau server in the SHARE button in your view.

    Hope this Helps!

      August 12, 2021 1:39 PM IST
    0