Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 82717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:39:39+00:00 2026-05-10T21:39:39+00:00

I have put together a script which is very much like the flickr photostream

  • 0

I have put together a script which is very much like the flickr photostream feature. Two thumbnails next to each other, and when you click the next or prev links the next (or previous) two images slide in. Cool!

Currently when the page loads it loads the two images. The first time nxt / prv is used then the next two images or previous two are loaded via ajax, with the id of the first image being passed in the url and the HTML for the two new images returned and displayed via ajax.

simple enough, but it got me to thinking, on a slow connection, or heavy server load then the two images, although relatively small thumbnails could still take a while to load, and the nice things with sliding panes is the fact that the hidden data slides in quickly and smoothly preferbly without a loading delay.

So I was wondering from a performance and good practice point of view which option is best, this is what I can think of for now, open to suggestions.

1, call each set of images via JSON (its supposed to be fast?)

2,load all the possible images into a json file and pull in the details that way – although browser will still have to load image. Plus sometimes there might be 4 images, other times there could be upto 1000!

3, Load 10 images via php into a Json or other file, and load all 10 images into the browser hiding the 8 which are not on show, and always showing the middle two. Problem here is that each time someone clicks, the file has to reload the first and last images, which still takes up time, although i suppose the middle images will have all been cached via the browser by now though. But still there is a loading time.

4, Is it possible to have a json image with all the image details (regardless of numbers) and use no 3 above to load 10 of those images, is it possible to use ajax to only read 10 lines and keep a pointer of the last one it read, so the json file can be loaded fast, short refresh and images either side are cached via the browser!!

Hope thats clear, any suggestions on how you would handle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:39:39+00:00Added an answer on May 10, 2026 at 9:39 pm

    To preload an image from Javascript, you don’t need to do anything that sounds like AJAX or JSON. All you need is this:

    var img = new Image(); img.src = 'http://example.com/new/image.jpg'; 

    The browser will quite happily load the image in the background, even though it’s not displayed anywhere. Then, when you update the src field of another (displayed) image tag, the browser will immediately show the part of the image it’s already loaded (hopefully all of it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer For the most part, you're correct. Applications with a safe… May 11, 2026 at 11:13 am
  • added an answer I am not sure if maybe I understand your problem,… May 11, 2026 at 11:13 am
  • added an answer Yes, but you need to have a ViewController (not a… May 11, 2026 at 11:13 am

Related Questions

I have put together a script which is very much like the flickr photostream
I have put together the following mootools script window.addEvent('domready', function() { var shouts =
Greetings: I have put together a RESTful web service in .NET 3.5 that takes
I have a utility that I put together that uses the .NET Framework to
I have a Window where I have put a Frame. I would like to
Into some view data i have put the result of an anonymous type: var
In my project I have put all my css classes in the style sheets.
I have a JLabel (actually, it is a JXLabel). I have put an icon
In my iPhone app, I have put a UIBarBUtton of type UIBarButtonSystemItemTrash in my
EDIT: Scotty2012 and David Morton's answers don't work for me so I have put

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.