Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS errors #7

Open
wpsumo opened this issue Dec 6, 2019 · 2 comments
Open

JS errors #7

wpsumo opened this issue Dec 6, 2019 · 2 comments

Comments

@wpsumo
Copy link

wpsumo commented Dec 6, 2019

@pcfreak30

Just dug a bit deeper and see some console errors related to off-set and jQuery. Also looks like there is compatibility issues with rocket-loader from Cloudflare.

Once we combine scripts into single scripts it also increases chances of conflicts and errors over only loading in the files as static files in the footer.

Uncaught TypeError: Cannot read property 'top' of undefined at HTMLAnchorElement.<anonymous> (ec364c2b104a51528ceb8133a2126724.js:53) at HTMLAnchorElement.dispatch (ec364c2b104a51528ceb8133a2126724.js:3) at HTMLAnchorElement.v.handle (ec364c2b104a51528ceb8133a2126724.js:3) at HTMLAnchorElement.c (rocket-loader.min.js:1) 4ec364c2b104a51528ceb8133a2126724.js:53 Uncaught TypeError: Cannot read property 'top' of undefined at HTMLAnchorElement.<anonymous> (ec364c2b104a51528ceb8133a2126724.js:53) at HTMLAnchorElement.dispatch (ec364c2b104a51528ceb8133a2126724.js:3) at HTMLAnchorElement.v.handle (ec364c2b104a51528ceb8133a2126724.js:3) at HTMLAnchorElement.c (rocket-loader.min.js:1) (anonymous) @ ec364c2b104a51528ceb8133a2126724.js:53 dispatch @ ec364c2b104a51528ceb8133a2126724.js:3 v.handle @ ec364c2b104a51528ceb8133a2126724.js:3 c @ rocket-loader.min.js:1 4ec364c2b104a51528ceb8133a2126724.js:53 Uncaught TypeError: Cannot read property 'top' of undefined at HTMLAnchorElement.<anonymous> (ec364c2b104a51528ceb8133a2126724.js:53) at HTMLAnchorElement.dispatch (ec364c2b104a51528ceb8133a2126724.js:3) at HTMLAnchorElement.v.handle (ec364c2b104a51528ceb8133a2126724.js:3) at HTMLAnchorElement.c (rocket-loader.min.js:1)

@pcfreak30
Copy link
Owner

As rocket loader is not something I can have any engineering control over, I am not sure I am in a position really to fix that. I also am not a fan of Cloudflare proxy myself and generally avoid their rocket loader. If you see a crash without cloudflare involved, then I can try and assist.

@wpsumo
Copy link
Author

wpsumo commented Dec 9, 2019

I think rocket loader is great to optimize how javascript is rendering. I just have great experience with the performance boost on on mobile devices which has the biggest challenges with the heavy javascripts.

But I think it is related to my jQuery which is to set the anchor links off-set for the sticky header.

Once disabled it is not throwing any console error in either way. But also loose my functionality of off-set that jumps a bit further than the headline due to sticky header.

var $header = jQuery('#_header-20-15');

jQuery('a[href^="#"]').click(function(e){
	e.preventDefault();
	jQuery('html,body').animate({scrollTop:jQuery(this.hash).offset().top - $header.height()}, 750);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants