Sempervivum I guess by SCRS you mean a mechanism as discussed here:
This can be done by keeping the nav on one page and loading the content of the other pages by javascript and ajax into that page.
Close. But some differences. Your example is more of CSR. All is done by the client.
In my example, the page is rendered on the server. Not by Javascript.
In Go the entire page is rendered by the server and send to the html header:
// write content to page
func get_content(w http.ResponseWriter, val string) {
content, err := ioutil.ReadFile("./public/tmpl/" + val + ".html")
if err != nil {
fmt.Println(err.Error())
}
fmt.Fprint(w, string(content))
}
And fetched by AJAX and inserted into innerHTML:
//paste entire rendered content into innerHTML
function content(page) {
sessionStorage.setItem("sub", page);
fetch("http://127.0.0.1:9082/content/" + page)
.then((res) => res.text())
.then((response) => {
document.getElementById("content").innerHTML = response;
})
.then(() => {
this.select();
})
.catch((error) => alert("Error content:", error))
}
So I wonder if this is a common or best practice to do it this way?
Bookmarking and navigation by Next and Previous in the Browser is not possible when no URL is showing and no history is saved. My demo in the thread referenced above works by hashes in the URL which enables for both
Bookmarking and history may be both positive and negative. The access to restricted areas may be simpler.