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 <e...@trakdrop.com> 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 <e...@trakdrop.com> 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 <dan...@roseman.org.uk> 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:
>
> > > > <script>
> > > >     $('.myClass').load('{% url update_dropdown %}',
> > > >         {'kind': "Book" },
> > > >         function(data){
> > > >             alert(data);
> > > >      });
>
> > > > </script>
>
> > > > 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
>
> > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> > > >         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>
> > > > <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> > > >   <head>
> > > >         <meta http-equiv="Content-Type" content="text/html;
> > > > charset=utf-8"/>
> > > >         <title>JQuery Examples</title>
> > > >         <script src="jquery-1[1].3.2.js" type="text/javascript"></
> > > > script>
> > > >         <script src="d6.js" type="text/javascript"></script>
> > > >   </head>
> > > > <body>
> > > > <p>We are going to organize the Conference on IT on 2nd Feb 2010</p>
> > > > <a href="abc.com" class="list">Participants</a>
> > > > <div id="message"></div>
> > > > </body>
>
> > > > //names info .htm with extra content to load
> > > > <p>The list of the persons taking part in conference </p>
> > > > <ul>
> > > > <li>Jackub</li>
> > > > <li>Jenny</li>
> > > > <li>Jill</li>
> > > > <li>John</li>
> > > > </ul>
> > > > <p>We wish them All the Best</p>
>
> > > Where is that script in relation to your base html file? Is it directly
> > > included (if so, you don't show it)? Or is it being loaded as an external
> > > script? If so, you can't put Django template code (eg the {% url %} tag) 
> > > in
> > > it, as it is not parsed as a template.
> > > --
> > > DR.

-- 
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