Javascript startsWith() help
This code is not working. I don't know much about Javascript but I am trying. The startsWith() function is what I added to the code and it killed everything. What am I doing wrong here?
- var idToShow = location.pathname.split("/")[1];
- if (idToShow == "index") {
- $("#home").show();
- }
- else if (idToShow.startsWith("_webapp")) {
- $("#district").show();
- }
There is obviously more to this but hopefully you will be able to see what is wrong here.
When ran it completely kills my code.
Thanks!
Austin