replacewith and dynmic content
Hi, firstly, great stuff, opened up a world of usefulnees when coding for iPhone/Pad.
I have a problem;
I want to create multiple dynamic instances to use replace with, but not sure how to generate and process each unique instance:
I generate a unique id, then apply that to each instance:
Loop over a database queryset
<a href="javascript:void(0);" id="$unique_id" onClick="playMe();return false;"><img src="placeholderimage" width="75" height="26"></a>
<script>
function playMe()
{
$('unique_id').replaceWith('newstufftoreplaceitwith');
}
</script>
obviously, this wont work as it generates multiple function scripts, so clicking on any of the instances will only replace the last item in the list.
How would I handle this with a single script call?
So, any item I click on can pass the relevant instance_id and therefor replace only itself?
Many thanks