Al 07/08/12 14:04, En/na mapapage ha escrit:

<script type="text/javascript">
$(document).ready(function () {
$("a").on("click", function(event) {
event.preventDefault();
var id = $(this).attr("id");
$.get("edit_wreqs"+"/"+id+"/", function(data) {
});
});
});
</script>

Disclaimer: I don't use jquery myself. My response is based on my experience with other js toolkits. The same ideas probably apply but the details may be different.

Well, you actually don't do anything with the value returned from the server (the function passed to 'get' is empty).

Once the 'get' call completes you'll get a chunk of HTML, corresponding to the rendering of the template 'main_Webrequests.html', that you should process in some way: the callback should locate the relevant HTML "code" within 'data' and insert-into/replace-part-of the current page with that "code". A quick googling shows that 'replaceWith' may be useful.

Depending on what you're trying to do it may be simpler (and faster) just fetching the object attributes from the server (instead of the whole page) and use those values to populate an edit form.



HTH

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to