
Fixed Docs JS error for Search on non-docs URLS
Bug Fixes
JavaScript errors from embedded Algolia search JS was looking for a #docsearch element that was only on pages using the docs template. Any page being loaded was using the search JavaScript code and non docs pages would throw the console errors.
What was the solution?
Check the page to see if the current page was in the/docsurl structure, if so load the search JavaScript code, otherwise do nothing. This solves the issue on non-search pages no longer loading the JavaScript when it wasn't needed, and no longer throws the console errors.
Posted on Utopian.io - Rewarding Open Source Contributors
Leave Fixed Docs JS error for Search on non-docs URLS to:
Read more #utopian-io posts
Best Posts From joepferguson
We have not curated any of joepferguson's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From joepferguson
- Building Homestead in 2022
- Exporting and Importing WSL Linux Distributions on Windows 10
- Down the rabbot hole
- Getting Connected to FIO Testnet
- Fixed Docs JS error for Search on non-docs URLS
- Add Golang 1.10
- Slim PHP when you don't need the kitchen sink - SunshinePHP 2018 Conference
- Homestead Welcomes Z-Ray by Zend
- The Only Way Out is Through
- How to move a dependency to Composer while requiring an old version