I am paginating a group of objects, each of which has a button that when pressed, opens a hidden div and pops the div in front of everything. What I want to do is list the attributes of that object in the window that pops up but I can't figure out how to fetch that object from the javascript code.
here is the javascript:
<script type="text/javascript">
$(document).ready(function(){
$("#create").click(function(){
$("#popupContact").load("/cookbook/createrecipe #createform");
});
$("#button1").click(function(){
$("#popupContact").load(load object information for button1);
});
$("#button2").click(function(){
$("#popupContact").load(load object information for button2);
});
});
</script>
here is the template:
{% block content %}
{% autopaginate object_list 6 %}
<div id="object_cont">
{% for object in object_list %}
<div id="object">
<div id="button{{ forloop.counter }}">
<h4>{{ object.name }}</h4>
<h5>{{ object.author }}</h5>
<h5>Prep Time: {{ object.prep_time }} minutes</h5>
</div>
</div>
{% endfor %}
</div>
<div id="popupContact" class="popup">
<a id="popupContactClose" style="cursor:pointer;float:right;">x</a>
</div>
<div id="backgroundPopup">
</div>
{% paginate %}
{% endblock %}
basically I need a way to fetch the object that is nested in the button div
thanks, snackerfish