I have two clickable elements in HTML like this:
HTML
var node1 = $('<a href="#" class="list-group-item"">' + fileName1 + '</a>');
var node2 = $('<a href="#" class="list-group-item"">' + fileName2 + '</a>');
They belong to the page with url say:
http://foobar/examples.html
They have onclick
listeners attached to them that retrieve some data from the server and display it on the webpage
Javascript
node1.click(function () {/*Displays table1*/})
node2.click(function () {/*Displays table2*/})
I want to change the URL for the two clicks just so that if I open the URL in a fresh tab, I get the node
element clicked and the data visible. For example, conceptually, the following URL should point to the node1
clicked and data for it visible:
http://foobar/examples.html##fileName1 (does not work, but you get the idea)
I do not want to change the URL in accordance with what has been explained here as I do not want to create an HTML page for every fileName
(it is an increasing list). Anchors don't help either as they just open http://foobar/examples.html
and none of the nodes
clicked . Neither is the answer to this question very clear to me. Can someone please help?