I have a div which contains data. I would like when a user clicks on the div, it to be overwritten with the contens of a file and the original content (hello) goes away, is this possible? example code below:
<a href="#"><div class="test">hello</div></a>
<script type="text/javascript">
$('.test').load('/new_file.php {cookieId:"<? echo $cookieId; ?>"});
</script>
So the <div> with class test is a link and when it is clicked it is overwritten with contents of the file new_file.php
Is my logic correct or needs to be re-worked?
If this is possible then what would be the <a> onclick command to fire it?
One line:
Though why are you sending the cookieId as a parameter? Isn’t it already being sent automatically as, well, a cookie?