CSS broken when using LOAD()

21 views
Skip to first unread message

blackthorne

unread,
Feb 4, 2012, 2:44:49 PM2/4/12
to web2py-users
hi,

I'm importing a JS gallery system to web2py using the LOAD. The idea
is to generate a gallery to a selected option asynchronously (AJAX).
I made the request LOAD to generate the right HTML code but the CSS
breaks because instead of
html > body > div.background > div.navigation-container >
div#thumbs.navigation > ul.thumbs > li > a.thumb > img

now, I have...
html > body > div.background > div.navigation-container >
div#thumbs.navigation > ul.thumbs > div #c529048618441 > li > a.thumb
> img

I am not a CSS expert but I could try to fix the gallery if I had a
way to "predict" the request.cid (component ID) there..
Any ideas?

Anthony

unread,
Feb 4, 2012, 2:46:51 PM2/4/12
to web...@googlegroups.com
LOAD(..., target='your_div_id')

You only get that randomly generated id if you don't specify the "target" argument.

Anthony

blackthorne

unread,
Feb 4, 2012, 3:14:47 PM2/4/12
to web2py-users
Thank you

blackthorne

unread,
Feb 4, 2012, 3:36:18 PM2/4/12
to web2py-users
btw, is there any way to only load the wrapping page when the loaded
component is complete so that JS behaves properly?

On Feb 4, 7:46 pm, Anthony <abasta...@gmail.com> wrote:

Anthony

unread,
Feb 4, 2012, 4:20:38 PM2/4/12
to web...@googlegroups.com
On Saturday, February 4, 2012 3:36:18 PM UTC-5, blackthorne wrote:
btw, is there any way to only load the wrapping page when the loaded
component is complete so that JS behaves properly?

Not quite sure what you mean. You could use LOAD(..., ajax=False), but then the component won't load asynchronously -- the entire page (including the component) will be generated and returned in a single request.

Anthony 
Reply all
Reply to author
Forward
0 new messages