This time I will share jQuery Plugin and tutorial about Asynchronous Page Loading Plugin In jQuery – AjaxPageParser, hope it will help you in programming stack.
AjaxPageParser is a jQuery plugin to ajaxify your website that asynchronously loads web pages (or a part of your web page) via AJAX just like a native mobile app.
The plugin displays a loading spinner while loading content from external pages and updates the title & page URL (OPTIONAL) when the page is completely loaded into the current page.
Also provides an error callback which will be fired when the page fails to load.
How to use it:
1. Download & unzip the plugin and include the latest version of the AjaxPageParser on your web pages.
1 |
< script src = "/path/to/jquery.min.js" ></ script > |
2 |
< script src = "/path/to/jquery.pageparser.min.js" ></ script > |
2. Create a page loading spinner on the webpages.
2 |
< span >< img src = "img/loader.gif" alt = "" /></ span > |
3. Create a navigation menu pointing to the pages within your website.
2 |
< a href = "/demo/AjaxPageParser/index.html" class = "active" >Index page</ a > |
3 |
< a href = "/demo/AjaxPageParser/pages/second.html" >Second page</ a > |
4 |
< a href = "/demo/AjaxPageParser/pages/third.html" >Third page</ a > |
4. Initialize the plugin on the menu items and specify the the container in which the data will display.
1 |
$( ".menu a" ).pageParser({ |
2 |
container: $( '#container' ) |
5. More configuration options.
01 |
$( ".menu a" ).pageParser({ |
18 |
// default attribute that holds the URL |
6. Event handlers.
01 |
$( ".menu a" ).pageParser({ |
This awesome jQuery plugin is developed by terwanerik. For more Advanced Usages, please check the demo page or visit the official website.