Re: Jquery load and views - double GET
On Monday, 29 September 2008 22:56:24 Benjamin Wohlwend wrote: > If you use > the URL with a trailing slash, only one request should occur. You sir, are a peach! That sorted it. What a relief; many thanks. \d --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Jquery load and views - double GET
Hi, I'm not sure, but it's possible that the first request is redirected from http://ddm/incunabula/zozo/authorartist to http://ddm/incunabula/zozo/authorartist/ <-- note slash If you have CommonMiddleware loaded and settings.APPEND_SLASH is True, Django will automatically redirect URLs without slashes. If you use the URL with a trailing slash, only one request should occur. Kind Regards, Benjamin On Sep 29, 10:47 pm, Donn <[EMAIL PROTECTED]> wrote: > Hi, > When I use $('blah').load() to fetch a response into a div it seems to be > pulling the data twice. This I see in Firebug where there are 2 GET headers. > > Here is the JS that is fired on a click of a span tag: > $('#pickoradd_author').click( function() { > $('#lister').load('http://ddm/incunabula/zozo/authorartist'); > > } ); > > #lister is a div. This all works but it pulls twice. The view does: > > return render_to_response('zozo.html', > context_instance = RequestContext( request ) ) > > Any ideas? > > The headers returned in Firebug are (cropped somewhat): > Response Headers > Content-Type text/html; charset=utf-8 > Location http://ddm/incunabula/zozo/authorartist/ > Content-Length 0 > Request Headers > Host ddm > Accept text/html, */* > X-Requested-With XMLHttpRequest > Refererhttp://ddm/incunabula/new/relic/book/ > Cookie sessionid=542f59886e684fa01268b7215bc761cf > > And also: > Response Headers > Transfer-Encoding chunked > Vary Cookie > Content-Type text/html; charset=utf-8 > Request Headers > Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > Refererhttp://ddm/incunabula/new/relic/book/ > Cookie sessionid=542f59886e684fa01268b7215bc761cf > > I am getting nowhere trying to savvy this. Any ideas? > \d --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Jquery load and views - double GET
Hi, When I use $('blah').load() to fetch a response into a div it seems to be pulling the data twice. This I see in Firebug where there are 2 GET headers. Here is the JS that is fired on a click of a span tag: $('#pickoradd_author').click( function() { $('#lister').load('http://ddm/incunabula/zozo/authorartist'); } ); #lister is a div. This all works but it pulls twice. The view does: return render_to_response('zozo.html', context_instance = RequestContext( request ) ) Any ideas? The headers returned in Firebug are (cropped somewhat): Response Headers Content-Typetext/html; charset=utf-8 Locationhttp://ddm/incunabula/zozo/authorartist/ Content-Length 0 Request Headers Hostddm Accept text/html, */* X-Requested-WithXMLHttpRequest Referer http://ddm/incunabula/new/relic/book/ Cookie sessionid=542f59886e684fa01268b7215bc761cf And also: Response Headers Transfer-Encoding chunked VaryCookie Content-Typetext/html; charset=utf-8 Request Headers Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Referer http://ddm/incunabula/new/relic/book/ Cookie sessionid=542f59886e684fa01268b7215bc761cf I am getting nowhere trying to savvy this. Any ideas? \d --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---