On Friday, 13 April 2012 08:08:19 UTC+1, Eli_West wrote: > > I've been attempting the most basic ajax call (.load() ) through > django for over a month now - each time trying a different method or > tutorial none with success. Can someone post a working paradigm for > whatever django csrf, firefox, ect. workaround they use? > > I can get jquery .load() to load content from an external file with > static files , no django. Same file served through django/templating > and the ajax is blocked. This is the general jquery call: > > $(document).ready(function() { > $('.list').click(function () { > $('#message').load('namesinfo.htm li'); > return false; > }); > }); > > To make things worse I found that Firefox/Chrome breaks Jquery's > sample 'Tabs: load content via ajax' in the Themroller download. But > it works in IE :/. Same .load() calls occuring here. Just working w > static files no django. Could it be related to Firefox/Chrome? > > I am pretty sure it is not: static file serving issues. I have heard > comments to follow django 'csrf / ajax' and included their sameOrgin > script to no avail. : > > https://docs.djangoproject.com/en/dev/ref/contrib/csrf/ > > A similar issue even though this guys solution is hard to understand: > > > http://stackoverflow.com/questions/6643242/jquery-load-not-working-in-django > > The argument to `load` is the URL you want to load. If you want that to be served by Django, you need to pass in a URL that's handled by your Django urls.py. 'namesinfo.htm' seems unlikely to be a Django url. -- DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/3CzEsK5NobAJ. 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.