0

I removed some HTML in the root path of a website, but when I navigate to an adjacent page, a large section of that page is gone as well. i.e. All the website's pages are under a div with a class name .core-rail. I removed the contents inside the div in the home page, but when I go to the notifications page everything inside of the .core-rail is also gone.

I would like to only remove the contents on the home page, and when navigating away have the contents recovered. I set all of the innerHTML to empty strings to remove it, if that helps.

George
  • 120
  • 8
  • It sounds like you have html content loading at divs with the class `.core-rail`. For the section where you don't want the content loaded, just change the class. That, of course, will effect the css of that div as well. This should also be evident through looking at other areas of your code - javascript, in particular. Without an example, it's difficult to tell exactly. – wahwahwah Dec 27 '20 at 03:05
  • Can you clarify what you mean by changing the class? Are you suggesting giving it a class that sets its contents to hidden? – George Dec 27 '20 at 03:35
  • Remove the class if it's the target for loading an html snippet – wahwahwah Dec 27 '20 at 05:36
  • It's a Single Page Application so it doesn't reload on navigation. It fakes navigation by using window.history.pushState. The solution is to keep the html as is, and use CSS to hide the content. When [the URL changes](https://stackoverflow.com/a/39508954) you will add/remove the CSS rule. – wOxxOm Dec 27 '20 at 07:50
  • Ah that is quite interesting! The website I am working with is LinkedIn. I am removing the central portion of the /feed page, which is everythingunder the `.core-rail` class. I'm still having trouble pinpointing the CSS class that is responsible for rendering the feed. Should I just be setting the class to blank for everything inside of `.core-rails`? – George Dec 27 '20 at 09:23

0 Answers0