dbiesecke
12/31/2015 - 12:02 AM

README.md

HTML Boilerparts


//http://www.hashbangcode.com/blog/using-jquery-load-content-page-without-iframe
<script>
     $(document).ready(function() {   
         var externalpagepart = '.container'
         var loadinggif = '/loading.gif';

         
                var toLoad = '/payload/ ' + externalpagepart;
                $('.content').slideUp('slow', loadContent);
                $('#waiting').append('<div id="load"><img src="' + loadinggif + '" alt="Loading" /></div>');
                $('#load').fadeIn('normal');
                function loadContent() {
                        $('.content').load(toLoad, '', function(response, status, xhr) {
                if (status == 'error') {
                    var msg = "Sorry but there was an error: ";
                    $(".content").html(msg + xhr.status + " " + xhr.statusText);
                }            
            }).slideDown('slow', hideLoader());
                }
                function hideLoader() {
                        $('#load').fadeOut('normal');
                }
                return false;         
     });
</script>


    <div id="container">
        <p id="waiting"></p>
        <div class="content"></div>
    </div>