Scalar 2 User's GuideMain MenuGetting StartedExplains account and book creation, and some interface basics.QuickStartsA path of all QuickStart content in this user's guide.Working with MediaHow to get the most out of your use of media in Scalar.Working with ContentCreating and editing content in Scalar.Working with WidgetsWorking with StructureHow to use Scalar's many options for structuring publications.Editorial WorkflowHow to use features for performing editorial review of content.VisualizationsExploring the contents of a book visually.LensesAn introduction to lenses, a tool for searching and visualizing Scalar content.Advanced TopicsDescribing Scalar's more advanced features.Third Party Plugins and Platforms
pageLoadComplete event
12017-01-10T21:45:40-08:00Craig Dietrich2d66800a3e5a1eaee3a9ca2f91f391c8a689349032961Information about Scalar 2's pageLoadComplete eventScScplain2017-02-04T16:00:36-08:00Craig Dietrich2d66800a3e5a1eaee3a9ca2f91f391c8a6893490Scalar 2 performs a fair amount of DOM manipulation when each page loads. Consequently, relying on the page 'ready' or 'load' events might produce unexpected results.
Instead, Scalar 2 includes a custom event, 'pageLoadComplete'. This event will fire when Scalar 2 finishes manipulating the DOM.
$(document).ready(function() { $('body').bind('pageLoadComplete',function() { // Do something to the DOM, such as change the "This page is tagged by" text $('.has_tags').prev().text('This is the new text'); }); });