Hi. We recently adjusted a few UI things on our site using the tagDiv, but now when we scroll down on our website we get this error printing out many times: Uncaught TypeError: Cannot read property ‘top’ of undefined
Our site is http://www.viteea.com
Please help. Thanks.
This error message also comes up: Uncaught SyntaxError: Unexpected token <
Hi,
Usually this is caused by plugins interfering in some way with the theme. In this case the errors are present only on the homepage and seem to be caused by the autoptimize plugin, or a setting in the configuration of this plugin
– https://www.screencast.com/t/x2emv6BrvIvG
Check if the errors are still present after disabling the plugin.
Thanks
Yes it doesn’t have anything to do with autooptimize. The erros are still there when disabling the plugin, but instead referring to a tagdiv file.
-
This reply was modified 8 years by
mkastrupsen.
When disabling autooptimize i get the same errors. See screenshot of error here: https://www.dropbox.com/s/fg2cntik8tdv4el/Sk%C3%A6rmbillede%202017-09-20%2012.25.41.png?dl=0
It points to this line of code:
(b+=tdAffix.menu_offset));”undefined”!==typeof window.tdThemeName&&”Newspaper”===window.tdThemeName&&(b+=20);var d=””;a!==tdSmartSidebar.scroll_window_scrollTop_last&&(d=a>tdSmartSidebar.scroll_window_scrollTop_last?”down”:”up”);tdSmartSidebar.scroll_window_scrollTop_last=a;var e=jQuery(window).height(),f=a+e;a+=b;for(var l=0;l<tdSmartSidebar.items.length;l++){var g=tdSmartSidebar.items[l];g.content_top=g.content_jquery_obj.offset().top;g.content_height=g.content_jquery_obj.height();g.content_bottom=….keeps going here
See another screenshot here: https://www.dropbox.com/s/dwuhyp56wo0ja4d/Sk%C3%A6rmbillede%202017-09-20%2012.29.20.png?dl=0
-
This reply was modified 8 years by
mkastrupsen.
Hi,
Then something else is causing the errors. Please try as a test to deactivate all plugins except theme provided plugins. Then clear the cache and check if the issue is still present, there should not be any errors anymore. The theme does not provide errors by default, something is conflicting with it and the result is this huge number of errors.
Please let us know the results.
Thanks
The weird thing is that we are not running any new plugins since we got those error messages, but i’ll try to disable some of then to get to the bottom of it.
Hi again. I can now confirm the error messages have nothing to do with our plugins installed. I have deactivated all and still get the error message. It’s definitely tagDiv related.
Hi,
The errors are multiplying when the page is scrolled, by the hundreds
– https://www.screencast.com/t/tkIOP4nnban
That is not normal behavior of the theme, this does not happen on a default theme as provided. If you are absolutely sure that a plugin is not the cause, maybe it is theme customization , custom code in the theme panel, a child theme. It is just a matter of identifying what exactly is responsible.
Thanks