Re: Jquery .load() function not responding with django

2012-03-15 Thread Eli_West
Found that jquery ajax does not load correctly in my firefox install.
Stock jquery example wasnt working either so I ran it in  a Windows IE
install.



On Mar 14, 8:59 pm, Eli_West  wrote:
> I just updated the jquery library so I shouldn't be that.
>
> Ive got to be doing something wrong.. theres no way .load() simply
> doesn't work with django.
>
> On Mar 14, 8:39 pm, Eli_West  wrote:
>
>
>
>
>
>
>
> > Thanks for the reply. It is loaded as an external script/file. That is
> > how it listed below right? Ive tried including it right in the file
> > too.
>
> > I think I know what you mean about using the url tag, I justed tried
> > this solution but with no results:
>
> >         $(document).ready(function() {
> >     $('.list').click(function () {
>
> >         $('#message').load('{{ url testload}}');
> >         return false;
> >     });
>
> > });
>
> > which calls a django view to serve the page. Still does not work
> > however, unless I am doing it incorrectly. Could it be a jquery
> > library error. Here is my django view and url now:
>
> > def testload(request):
> >     return render_to_response('tdcreative/testcontent.htm')
>
> > 
> > // in url conf
> >  (r'^tdcreative/testload/$', 'tdcreative.views.testload'),
>
> > On Mar 14, 12:02 pm, Daniel Roseman  wrote:
>
> > > On Wednesday, 14 March 2012 09:21:29 UTC-7, Eli_West wrote:
>
> > > > I've ran into in issue where jquery .load() will load extra content by
> > > > directly opening html file in a browser but if served through Django
> > > > devel server the jquery load() is ignored. Have no idea what could be
> > > > happening but I've seen someone use a django url in the .load() call
> > > > instead of pointing .load() directly to a file:
>
> > > > 
> > > >     $('.myClass').load('{% url update_dropdown %}',
> > > >         {'kind': "Book" },
> > > >         function(data){
> > > >             alert(data);
> > > >      });
>
> > > > 
>
> > > > He said he saw issues with a jquery library Any thoughts would be
> > > > great. BTW not a static file serving issue. Here is the very simple
> > > > code that works w/o django, but same thing loaded through django
> > > > fails:
>
> > > > ///code from apress jquery, thanks to Bintu Harwani
>
> > > > basic jquery load function
>
> > > > $(document).ready(function() {
> > > >     $('.list').click(function () {
> > > > $('#message').load('namesinfo.htm li');
> > > >         return false;
> > > >     });
> > > > });
>
> > > > /basic html file
>
> > > >  > > >         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;>
>
> > > > http://www.w3.org/1999/xhtml; xml:lang="en" lang="en">
> > > >   
> > > >         
> > > >         JQuery Examples
> > > >          > > > script>
> > > >