I currently have a php script which is loaded by Javascript when a button is clicked. It creates all the html content which looks like this once loaded
<ul>
<li>
<a href='foo.php?var=abc123'>
</li>
<li>
<a href='foo.php?var=def123'>
</li>
</ul>
So when a link is clicked, it uses GET to send PHP variable to same script, and it brings up another list of results.
What I want to do, is when you click a link instead of going to a new page with results, it loads them below this part to result in something like this (like a treeview():
<ul>
<li>
<a href="#" id="abc123">abc123</a>
</li>
<ul>
<li>
<a href="#" id="jkl123">jkl123</a>
</li>
<li>
<a href="#" id="ghi123">ghi123</a>
</li>
</ul>
<li>
<a href="#" id="def123">def123</a>
</li>
</ul>
I can get it to work if I use static variables, but i need to find a way to take the variable from the created html on click, put it into the javascript function, so it can execute the PHP script.
Thanks.