1

Is it possible to load first JQuery slide, show page, then load the other slides in the background?

I have got a jquery slide that shows an xml feed of 4 different sources.

Each slide has its own xml feed.

The problem is that xml feeds can load very slowly.

I thought it would be a good idea to load one xml feed while loading the rest of the page and load the other slides (feeds) in the background.

Is this possible?

2 Answers 2

1

Sure you can, just read the XML and store it locally in a variable. You can start loading it using an ajax call when the page loads, and when this ajax call ends make another call to read the next slide and so on.

Keep an array to mark which feeds have already been read, and when displaying a slide, first check the array to see if the current slide index has already been read, otherwise wait until the xml reading is finished, and read the content from a variable instead of the direct xml reading call.

If you need help coding that upload your current code. Let me know if you need any more help.

1

Solved it by creating a cronjob and loading the data in an sql database once a day

Thank you for your response Kuf

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.