I have a few divs which are generated automagically from a php loop.
<div class="link_0"><a href=# onclick="getLink('20120922','0');">Get Link</a></div>
<div class="link_1"><a href=# onclick="getLink('20120922','1');">Get Link</a></div>
<div class="link_2"><a href=# onclick="getLink('20120922','2');">Get Link</a></div>
I’m trying to use jQuery to replace the correct div the user click on with the content from another php query.
function getLink(thisDate, i)
{
$.post("json.php?page=ajax", { date: thisDate },
function(data) {
('.link_'+i).html(data);
});
}
I’m at my wits end trying to figure out what I’m doing wrong. Any help would be appreciated.
It looks like you are missing the dollar sign ($(…))! 😉