1

I know that similiar questions were asked thousands of times, but none of the solutions meet exactly what I need. My scenario is as follows: I developed an online quiz which basically consists of a java-script, a css-file and a html-file that contains many images and some audio files. The online quiz works, but is very slow, since all the media consumes up to 15mb space.

How can I pre-load all the media files (images & audio) ? I don't want to list all individual image names in a array - there must be a way that pre-loads the media on the basis of an "id" or "class" or the "tag-type"?

2
  • 1
    on the basis of an "id" or "class" or the "tag-type" If you have a <img> tag with src set, then it already started downloading as you include that in your DOM. Commented Jan 30, 2014 at 9:16
  • You should think to shrink our media sizes, its very painful on slow connections, dont start the quiz until all media has been loaded, just show a progress bar Commented Jan 30, 2014 at 9:41

1 Answer 1

1

Presuming you have a list of named media files stored on the server than you can only load or preload them by name anyway. If the quiz asks the questions in some predefined order then you could preload the next media file while the current question is being answered.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.