On Monday, March 23, 2015 at 6:27:25 PM UTC-7, Dave S wrote: > > > > On Monday, March 23, 2015 at 5:52:46 PM UTC-7, Anthony wrote: >> >> LOAD generates a div with an id set to the value of the "target" >> attribute, so you do not want to put LOAD inside a div that already has >> that id (then you will get nested divs with the same id). >> > > You're right, I do, as I noted above, but after the LOAD() completes, I > just have the target DIV, with only the LOADed contents inside. > > So, I got away with it for now. > > If I move the LOAD() to above the DIV (source file view, as in the admin contoller's edit screen), then everything still pretty much works, but FF's Inspect Element shows that I have 2 DIVs with the same id *after* the load, with the LOADed results in the remote one instead of in my target, and the spinner is still in my target.
Looking again at <URL:http://www.web2py.com/books/default/chapter/29/12/components-and-plugins?search=LOAD%28%29#LOAD>, it seems the example DOESN'T have a pre-existing DIV. To clean up my code, I need to do the 'contents=' parameter with the spinner as well as the text. (The "jsoffs " stuff should be able to be moved into the outer environment (good ol' "span12"), because it can lay around hidden forever and ever.) Side note: In FF, "Show Source" always shows the pre-load version. "Inspect Element" shows the updated contents. This might help some later reader. /dps > /dps > > >> On Monday, March 23, 2015 at 8:44:51 PM UTC-4, Dave S wrote: >>> >>> [...] >>> >> Here's the code I use for load(); notice the LOAD() is inside the target >>> DIV: >>> >>> <DIV id="my_hats"> >>> {{=LOAD(c='thats', f='thats2.load', target='my_hats', ajax=True)}} >>> <span id="jsoffs">Javascript off? <a href="thats2.html" id="jsoffa" >>> >Click here</a></span> >>> <br> >>> <span class="fa fa-spinner fa-spin"></span> >>> </DIV> >>> >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

