Michdd Posted June 24, 2009 Share Posted June 24, 2009 Couldn't think of a better title x.x For some Chat website that I made in AJAX/Php There's a section that contains images of smilies. This is about 250KB of images, so it's not really friendly to load it when the page starts. Currently there's a function I made in php which gets the contents for the smiley DIV, (contains image links with an onclick attribute). Now I guess the best way to do this would be through Ajax? But I'm not really sure.. I want to create a button that when pressed will preload all the images, (Temporary showing a [Loading] bar) Then once they're all loaded it will switch the contents of that DIV. I can think of a few ideas, but I'm thinking there's a better way.. My one idea would be through 2 Ajax queries.. First one sending back an array to JavaScript containing the names of all the smilies, so it can loop through the array, and preload the images, then the second Ajax query running once that's finished, to get the contents of the DIV itself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.