In web2py_ajax.html, if I insert files in response.files by index,
they are rendered out of order.

response.files.insert(0,URL(r=request,c='static',f='jquery.js'))
response.files.insert(1,URL(r=request,c='static',f='calendar.css'))
response.files.insert(2,URL(r=request,c='static',f='calendar.js'))
response.files.insert(3,"http://ajax.googleapis.com/ajax/libs/jqueryui/
1.7.2/jquery-ui.js")
response.files.insert(4,"http://ajax.googleapis.com/ajax/libs/jqueryui/
1.7.2/themes/ui-darkness/jquery-ui.css")

...renders in this order...:

/sliderwidget/static/calendar.css
http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css
/sliderwidget/static/base.css
http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js
/sliderwidget/static/jquery.js
/sliderwidget/static/calendar.js

Perhaps 'tuple(set(response.files or []))' is changing the order.

On Nov 2, 1:06 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I do not understand
>
> On Nov 2, 1:02 pm, "mr.freeze" <nat...@freezable.com> wrote:
>
> > Confirmed, using an index variable fixes it:
>
> > for i in xrange(0,len(response.files)):
> >   _file = response.files[i]
> >   if _file[-4:].lower()=='.css':}}
> >      <link href="{{=_file}}" rel="stylesheet" type="text/css"
> > charset="utf-8" />{{
> >   elif _file[-3:].lower()=='.js':}}
> >      <script src="{{=_file}}" type="text/javascript"></script>{{
> >   pass
> > pass
>
> > On Nov 2, 12:59 pm, "mr.freeze" <nat...@freezable.com> wrote:
>
> > > Actually, it looks like even though it is being inserted at index 0,
> > > it is being rendered after other items so it throws this error. I am
> > > inserting like so:
>
> > > response.files.insert(0,URL(r=request,c='static',f='jquery.js'))
> > > response.files.insert(1,URL(r=request,c='static',f='calendar.css'))
> > > response.files.insert(2,URL(r=request,c='static',f='calendar.js'))
> > > response.files.insert(3,"http://ajax.googleapis.com/ajax/libs/jqueryui/
> > > 1.7.2/jquery-ui.js")
> > > response.files.insert(4,"http://ajax.googleapis.com/ajax/libs/jqueryui/
> > > 1.7.2/themes/ui-darkness/jquery-ui.css")
>
> > > Perhaps it should use an index variable so that the order is
> > > controlled?
>
> > > On Nov 2, 12:36 pm, "mr.freeze" <nat...@freezable.com> wrote:
>
> > > > I think the jQuery file included with web2py may be corrupt.  When I
> > > > create a new app firebug throws an error: 'jQuery is not defined'. The
> > > > error goes away when I use the google hosted version instead.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to