Golly gosh Ajax spinners ("throbbers" if you must use the correct term) are boring. They just spin. Not my Ajax throbber. It rocks.
No longer do you have to bore your users to tears waiting for your Ajax requests to complete - you can keep them thoroughly entertained with this historically accurate representation of the loading screen of the Commodore 64. Ah, how your users will smile with memories of waiting for America's Cup Challenge to load from cassette, but always stopping after 30 minutes, and even if it did ever load, being a really crappy game.
If that's the kind of emotional User Experience you want your apps to evoke, read on!
The code is based on my entry for the fantastically inspiring js1k competition. I expanded it to make it slightly more readable, and add a futuristic API.
To start the "spinner":
To change the message displayed:
To load in a particular containing element:
LOAD("#myDiv",8,1) (the final parameter is the z-index to set the container)
There are a bunch of settings which can be accessed by PEEKing and POKEing in the RAM and ROM banks. For example, to change the containing element (ROM location 0):
POKE(0,"#myDiv") and to read it back and print to screen:
The RAM bank is stored from memory location 49152 (decimal):
The banks are not fully documented of course. Check out the source if you want to modify things. I'm not giving you any more information than that - it would go against the spirit of the C64.
lolz, this makes me want to build something just so I can use this ajax loader
Ha, pretty cool :D I’m just afraid that a lot of todays users have absolutely no clue what this weird blinky bordered blue screen is :/
BROUGHT TO YOU BY THE POMPEY PIRATES
GREETZ GO TO AUTOMATION, MEDWAY BOYS AND FLAME OF FINLAND
(press ‘t’ for trainer)
Simply brilliant! I like the API as well!