There is a computer that has a website hosted on the web browser via JavaScript and other computers can connect to that website and access it, once that computer has loaded the website on it's browser then other computers can access it from that computer, so as long as there is a active user on the website at the moment running the JavaScript that is hosting it then the website is online. Once there is no one on it it goes offline can can't get online again.
The purpose of a non server based website is that it would, well not have a server which can therefore cannot be taken down no matter what as long as the users use it, it cannot be traced too since you connect to it via different public IP addresses. How do you know what address you should connect to? I don't know yet, maybe logging the computers that have accessed it on the website source code and then pining those to see if they are online, not sure myself. All this allows for complete anonymity and no trace ability, but finding a way to refresh all the sites without immense computational power to dispose is also still a mystery for me.
How do i host a website on the JavaScript that is available to execute on web browser or is it even possible. If it is not then is there a possibility to create a library for the JavaScript and embed it in the source code of the site? If that does not work, what way is there to make a P2P based website that can refresh at a modest speed?
How do i host a website on the JavaScript that is run on a web browser?
This is not only possible, it's commonly done!
There are some caveats though. First, to make peer-to-peer (P2P) connections in-browser, you need to use WebRTC. To make a WebRTC connection, the browsers first have to communicate over a signalling channel to negotiate protocol version, any media channels (if used), and what addresses to connect with. That signalling channel generally requires a server. (There are some neat WebRTC signalling methods that use QR Codes to send data visually... but those only work if the devices' cameras can see the other screen, such as in the same room.)
Because of this requirement, and the extra overhead of distribution, P2P web serving is usually reserved for bandwidth intensive requests, such as HD video segments. There are commercial products for this: https://www.peer5.com/
Also, check out WebTorrent. https://webtorrent.io/ There are many projects built off of it around what you are asking.