I need to adjust the DOM via jQuery during a page load. With normal page loads, I can easily do this using an Inline javascript with code such as: (function(skuid){ var $ = skuid.$; $(function(){ $(‘#StatusPicklistFrame’).hide(); }); })(skuid); However, when the page is loaded via a Page Include - this script triggers before the DOM has been fully populated with the dynamically loaded content. The script does run as the page is loading (meaning, it waits until the Page Include begins) - but runs before I can find the objects in the DOM. In my case I’m trying to hide a Field Editor frame, which does not have any customer field renderer attached to it. I did try hooking to a field renderer on a field within the Field Editor, but I don’t appear to have access to the parent objects in the DOM. Is there a different way for me to receive a Page Include complete event so I can adjust the DOM prior to the content being visible to the user? Thanks, - Chris
Page 1 / 1
Hi Chris, Skuid throws a “pageload” event to the document body whenever the page is ready. This happens when page includes are finished loading as well. You can use the code below instead of jQuery.ready.
$(document.body).one('pageload',function() { // My code here. });
That does it - thanks! (for others who may read this… add the line ‘var $ = skuid.$;’ at the top of this snippet to define the jQuery interface on $) - Chris
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.