Send values from article to article

by Ariel Ballestero   Last Updated June 19, 2018 17:10 PM

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>


Related Questions


If element exists in article - load extra data

Updated May 06, 2015 10:15 AM

Run External PHP File From Joomla Article

Updated February 23, 2017 01:10 AM


Cannot find featured articles on Joomla Backend

Updated February 22, 2017 02:10 AM