I have two articles in my Joomla site. One article has various links to the same article. The other article display, with code of java script, the HTML content of a file depending on what link was clicked in the previous article. How can I send a variable with the option that the user clicked and get that variable in the other article?
This is the code of javascript that show the file in the second article. Right now shows a specific file but I want that the file name were the option that received from the first article
<script language="javascript" type="text/javascript">
file="http://1.1.1.1/mysite/files/test.html"
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function ()
{
if(rawFile.readyState === 4)
{
if(rawFile.status === 200 || rawFile.status == 0)
{
var allText = rawFile.responseText;
document.getElementById("content_file").innerHTML=allText;
}
}
}
rawFile.send(null);
</script>