Showing posts with label preload. Show all posts
Showing posts with label preload. Show all posts

Thursday, March 6, 2014

jQuery UI: Pre-loading Remote Tab Content

The tabs widget can support remote content just as well as it does local div elements. All we have do is point the href attribute to some remote HTML that we want rendered when that tab is activated. The widget is smart enough to understand that we're referencing a URI, and not a local DOM ID. The content, for any given tab referencing remote content, is loaded when the tab is selected. Not before. However, this content is cached, so the second time the user selects a tab with remote content, it'll render instantly. There's a pre-loading trick you can use to give the perception of even faster loading time.