Webmastersite.net

Search    Register    Log In   

Details

Single page app behavior for WSN
By
May 31, 2019 am31 5:48 AM

Sometimes you may want something that behaves more like a single page app instead of a website. For that, today I've introduced a new tweak 'ajaxsite'.

What this does is it transforms all internal links into javascript calls. The javascript immediately replaces the whole <div class="main"> middle section of the page with a loading indicator graphic, then it loads the requested URL with &usewrapper=no tacked on to suppress the wrapper, and places that inside the <div class="main"> area. The result is that the top and bottom of the page remain static and the URL doesn't change, while the middle of the page loads changes when you click categories and listings and other stuff.

The one big limitation here is forms. There's no safe universal way to convert form submissions to AJAX (mainly because some of them involve file uploads), so forms still submit in the traditional HTML way with your browser loading a new page. If someone is interested, I could work on a form method that'd work for most people's site configurations but not be universal.




Views 733 views. Averaging 733 views per day.
Similar Listings
Page speed tools
Page Speed Enhancements
File browser, page speed and fixes
WSN 10
WSN 10.0.5 changes

Sorry, you don't have permission to post. Log in, or register if you haven't yet.

Please login or register.