Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var RLoad = {};
- RLoad.LoadCount = 0;
- RLoad.Scripts = [
- 'js/rajax/Rajax.Type.Identifier.js',
- 'js/rajax/jquery.rajax.transition.js',
- 'js/rajax/jquery.rajax.ajax.js',
- 'js/rajax/jquery.rajax.navi.js',
- 'js/rajax/jquery.rajax.watch.js'
- ];
- $(function() {
- //$.ajaxSetup({ cache: true });
- RLoad.PreloadView = $('<div style="position:absolute; top:7px; left:7px; border:1px solid black; background:white; padding:3px; font-size:10pt; font-family:\'courier\'" />').appendTo($('body'));
- function autoloadScripts(url)
- {
- if(RLoad.LoadCount <= RLoad.Scripts.length)
- {
- $.ajax({
- url: url,
- dataType: 'script',
- success: function() {
- $(RLoad.PreloadView).html('Loading: ' + Math.round(RLoad.LoadCount + 1 / RLoad.Scripts.length * 100) + '% / 100%');
- autoloadScripts(RLoad.Scripts[RLoad.LoadCount]);
- },
- error : function() {
- $('body').append('<br />File in ' + url + ' could not be loaded.');
- }
- });
- RLoad.LoadCount += 1;
- }
- else
- {
- $(PreloadView).remove();
- }
- }
- autoloadScripts(RLoad.Scripts[0]);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement