# Uncaught TypeError: Cannot read property 'length' of undefined - Kibana Dash board

**URL:** <https://discuss.elastic.co/t/uncaught-typeerror-cannot-read-property-length-of-undefined-kibana-dash-board/114452>\
**Category:** Kibana\
**Created:** [January 8, 2018, 6:44am UTC](https://discuss.elastic.co/t/uncaught-typeerror-cannot-read-property-length-of-undefined-kibana-dash-board/114452 "2018-01-08T06:44:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruranga](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@ruranga](https://discuss.elastic.co/u/ruranga)\
**Post date:** [January 8, 2018, 6:44am UTC](https://discuss.elastic.co/t/uncaught-typeerror-cannot-read-property-length-of-undefined-kibana-dash-board/114452/1 "2018-01-08T06:44:15Z")

</div>

I'm rotating dashboards using simple HTML/Js code running on Tomcat. Code is as follows

 body, html { height: 100%; overflow: hidden; padding: 0; margin: 0; }

```
        .page {
          top: 0; 
          left: 0; 
          width: 100%; 
          min-height: 100%; 
          position: absolute; 
          display: none; 
          overflow: hidden;
          border: 0;
        }

        .currentPage { 
          display: block; 
        }
    </style>
</head>
<body>
    <script>
        var TIME_PER_PAGE = 10000;
        window.onload = function() {
            var pages = document.querySelectorAll('.page'),
                numPages = pages ? pages.length : 0;
                i = -1;

            function nextPage() {
                if (i >= 0)
                    pages[i].classList.remove('currentPage');

                //i++;
                i = (i + 1) % numPages; 
                pages[i].classList.add('currentPage');
               // if (i < numPages - 1)
                  setTimeout(nextPage, TIME_PER_PAGE);
            }
            nextPage();
        }
		
    </script>

<!--star points transactions-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/5dc9a151276c66cd77a85dedb61cc344" style="border: 0; width: 100%; height: 100%"></iframe></div>
 
<!--ezCash SMS notifications-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/9a87536f45eb55594de98c4e4d697ba6" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--ezCash transactions-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/ecb52d0dcef43530e4a494628efee2e7" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--ezCash Channels-wise-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/c7e5da66601215652cb73205ffbd7b86" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--ezCash AGENT Transactionss-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/83d0bafec5aabdda75c93242182dc922" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--ezCash WEB agents (IPG) Transactions-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/829848db19f4271e0c1cffdd04013172" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--NFC Bus Ticket Transactions-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/7a81e0e68ce3cd739754ba0b589707e0" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--NFC TopUps-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/704bcd00904b5a97b013b1c6105fc68a" style="border: 0; width: 100%; height: 100%"></iframe></div>

<!--NFC FQMS Transactions-->
 <div class="page"><iframe src="http://X.X.X.X:5601/goto/8b82be2bdcb66e1b29717b2c786a013c" style="border: 0; width: 100%; height: 100%"></iframe></div>

  </body>
</html>

```

But when loading above using Chrome following error appears for some of the dash boards

 ![kibana_error](https://us1.discourse-cdn.com/elastic/original/3X/8/5/855b74906a99e35b4f92c8dee74e75f56fca4adf.png)

Can some one please help me?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [January 8, 2018, 3:04pm UTC](https://discuss.elastic.co/t/uncaught-typeerror-cannot-read-property-length-of-undefined-kibana-dash-board/114452/2 "2018-01-08T15:04:17Z")

</div>

Hi @ruranga,

it is a known effect in some browsers that iframes loaded in invisible container elements are rendered with a width and height of 0, which confuses the dashboards. The common solution for that is to lazily load the iframes when they first become visible. You could, for example, replace the `src` attribute on your `iframe`s with `data-src` and copy it over to the `src` in your javascript when `currentPage` is first applied.

---

<div class="post-metadata">

**Author:** ![ruranga](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@ruranga](https://discuss.elastic.co/u/ruranga)\
**Post date:** [January 10, 2018, 3:52am UTC](https://discuss.elastic.co/t/uncaught-typeerror-cannot-read-property-length-of-undefined-kibana-dash-board/114452/3 "2018-01-10T03:52:23Z")

</div>

Thanks for the help. I will try 👍

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 7, 2018, 3:52am UTC](https://discuss.elastic.co/t/uncaught-typeerror-cannot-read-property-length-of-undefined-kibana-dash-board/114452/4 "2018-02-07T03:52:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
