I can't seem to make it happen quick enough. It always wants to go back to the server. I am using frames. In one frame, I set up my new Image()...

How It Works

Get an answer in three easy steps. Here's how it works...

Ask Your Question

1. Ask Your Question

Enter your programming question at the top of this page and click Get An Answer.

Pick Your Priority

2. Pick Your Priority

Tell us how quickly you want your programming question answered.

Get An Answer

3. Get An Answer

Connect with your programmer via online chat or telephone call.

Answer

Customer
I can't seem to make it happen quick enough. It always wants to go back to the server. I am using frames. In one frame, I set up my new Image() variables and set them equal to the image source. In another frame, I use an IMG tag, but don't set the source. Every once in a while, I call a function in that page that sets the image objects' source to the source of the images of the other frame. It works fine, but if I run it on a slow server, you can see in the status bar that the browser is going back to the server for the images. Any suggestions would be greatly appreciated.
Posted
Matthew Pomar
Customer Support
I don't believe the browser will cache an image without src="/images/myimage.gif." What is the real issue here? Is it that your image files sizes are too big? Regards, Matthew Pomar
Posted
Customer
No. Acutally, they are quite small. 7x30 px. JPEG files. I wish I could show you, but they are behind a firewall. The problem is that there are several of them and every one of them is causing the browser to go back to the server to download it again. Because of the firewalls and security setup, the site is a bit slow. My little images make it almost unbearable. Here is what I do: var tabSiteLeft = new Image(); var tabSiteRight = new Image(); tabSiteLeft.src = "images/tabSiteLeft.gif"; tabSiteRight.src = "images/tabSiteRight.gif"; Then, to use them, I do: document.tabSiteLeft.src = window.parent.frameHeader.tabSiteLeft.src; document.tabSiteRight.src = window.parent.frameHeader.tabSiteRight.src; I know in my text here, the naming looks confusing, but the first section is in a frame titled "frameHeader" and the second section is in another frame. I used the same name in both pages to make it simple. It was my assumption that the way I set up the images, the would be stored in the browser cache, and subsequent retreivals would happen from that cache, not the server. Is that wrong? Is that just IE's implementation. If so, what benifit is that? Is my problem due to the fact that I am using a different frame for setting up the image variables? Thanks for the replies!! John
Posted
Matthew Pomar
Customer Support
Ok, I think I see the problem. It appears you are loading the images correctly. I would suggest you preload the images by seting up a function in the body tag: This way the image is already loaded when you decide to display it. An example of this in action can be seen on a site I am working on: http://209.19.255.21/pq_wizard_4a.asp?ItemId=1 Hope this helps. Regards, Matthew Pomar
Posted
Customer
Am I crazy, or is your site doing it too? I mean, if you look at the status bar while passing over several of them, you can see "Downloading picture http://blah blah blah" Since your images are small and your server is responding fast, it could be doing the same thing that mine is. What I mean is, does your page respond instantaneously if those image file are say 80k each???
Posted
Matthew Pomar
Customer Support
A few questions: 1. What broswer ver are you using? 2. What are your cache settings set to? - Matt
Posted
Matthew Pomar
Customer Support
And yes, the images are instant on my browser (IE 5.5) or any browser I've tested it with (netscape, or ie).
Posted
Matthew Pomar
Customer Support
This is it - if you set your browser check for a newer version of the page each visit, it will load the images fresh everytime they are accessed. My code worked correctly until I changed my browser to load the page new everytime. - Matt
Posted
Customer
Yeah, it was that for your page. I changed those settings so that it wouldn't behave that way for my site, but it was still doing it. I think it may be a case of being on a different page. I am going to move the stored image code to the corresponding page. The reason we set it up the way we did was because we used to reload those pages that used the images, but not the one that held them as variables. We no longer reload the page, but rather do a body.innerHtml to replace the page code but keep the globals. Thanks for your help. Oh yeah, and Nortel thanks you too. Later, John
Posted

quoteTestimonialsquote

About ExpertHelp

ExpertHelp is changing the way you connect with service professionals.

Whether you have a quick question while preparing your taxes, troubleshooting a computer problem, or need to hire an attorney, ExpertHelp is the most convenient and affordable way to connect with the right service professional to get the job done.

ExpertHelp has been in business since 2011, is an A+ Rated Better Business Bureau accredited member, and offers a 100% satisfaction guarantee on every question you ask!

More Programming Questions...

Ask Your Programming Question & Get An Answer Now!