I am trying to fetch more detailed data and show this info ad-hoc in the same window. On bigger screens. On smaller screens I want to hide the list and show detailed when double click.
To illustrate my goal, i have done a very simple write to innerHTML.
const selected = table.getElementsByClassName(‘selected’)
“`
table.onclick = sel;
function sel(row) {
if (selected[0]) selected[0].className = ”;
row.target.parentNode.className = ‘selected’;
table.className = ”;
add2card(row.target.parentNode.innerHTML)
}
function add2card(text){
document.getElementById(“add2card”).innerHTML = text;
}
I have found three ways to do this.
1. Fetch data via AJAX ( do not know how to parse and format the json )2. Fetch the normal way and show in an iFrame3. Store all content in the list (some data hidden) and do basically as above.
Are there more ways to achieve this goal. Faster or simpler?
Any tip or advice welcome!
TIA!