473,408 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

innerHTML and images loading

Dear All,

I have a little strange problem with using innerHTML property to
update my browser document.
The HTML content I am inserting in document contains images. These
images are to be downloaded from the web.
Well, they are downloaded and everything works, BUT:

on relatively small network, I can see how these images are loaded one
by one, as if requests for these images were sent sequentuially. This
does not happens if I get the same content in "common" way (not using
innerHTML).

Have anybody seen this effect ?

I had a kind of hypothesis about it. Maybe setting innerHTML through
javascript (which is what I am doing) works in a signle thread, and
this is a reason why requests are sent sequnetially ?

Thanks & Regards,

Nick
Jul 20 '05 #1
1 6925
Ivo
Not sure what the problem is. Do you want all images to be there at
the same time? Preload them. That is: tell the browser you are going
to need image This and image That, and it will download and cache
them, so that they are instantly displayed the moment you set your
innerHTML.

You tell the browser to cache an image with something like:
var ima= new Image(); var ge=new Image();
ima.src="This.gif"; ge.scr="That.jpg";

or a function that takes an arbitrary number of files (you can also
preload css and script files or other pages) as its arguments:
function preload(n){
for(i=0;i<arguments.length;i++){
x=new Image();x.src=arguments[i];
}
}
preload("This.gif","That.jpg");

If something else is the problem, disregard this post.:)
I believe every browser has an x number of ports or threads to
download a page and its associate files. The more pages I request at
once, the more apparent the sequential loading is.
HTH
Ivo

ni**********@yahoo.com (nick) wrote in message news:<83**************************@posting.google. com>...
Dear All,

I have a little strange problem with using innerHTML property to
update my browser document. The HTML content I am inserting in document contains images. These
on relatively small network, I can see how these images are loaded one
by one, as if requests for these images were sent sequentuially. This
does not happens if I get the same content in "common" way (not using
innerHTML).

Have anybody seen this effect ?

I had a kind of hypothesis about it. Maybe setting innerHTML through
javascript (which is what I am doing) works in a signle thread, and
this is a reason why requests are sent sequnetially ?

Thanks & Regards,

Nick

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: JimMenees | last post by:
(code is at end of post) ------------------------------------------- I'm using an i-frame to grab a server-side text file and display its content elsewhere in the html document. On change of the...
7
by: Frostillicus | last post by:
Hi, I've written some javascript to randomly choose a classical music composer's picture and sample audio and display it on my home page (http://marc.fearby.com/), and this works fine in Mozilla...
1
by: Izzet Pembeci | last post by:
I am trying to display some rss feeds in my homepage. To do that I am using an external script which returns smth like: document.writeln("<div ...>") document.writeln("Title of News 1") !! read...
1
by: mboso | last post by:
I have a function that works in firefox, but is having some issues in IE. What it does is place an image in a specified cell, when an icon in the adjacent cell is clicked. I have to click the link...
4
by: VR | last post by:
Hi, I am trying to have a menu item (which is an HTML img) to change as a mouse moves over it. So, my code looks something like this: <a onmouseover="ActivateImage('MyImage');"...
6
by: snazzy | last post by:
I have a problem where using innerHTML to rewrite a DIV or removeChild to kill a DIV that either of them, if excuted before the page is done loading will stop the page in its tracks. ...
3
by: littleark | last post by:
Hi everybody, I have a typical javascript images preloader, it works fine both on Firefox and on IE in my intranet (local server). It works fine on the Internet (remote server) in IE. In...
0
by: speedcoder | last post by:
hi all, i'm stumped. my applet used to load images over the network. (it was actually designed by someone else.) yes, the applet used to load each image file independently over the network and...
3
by: zero0x | last post by:
hi all, i'm trying to create something like window in javascript. there is no problem in firefox, but in microsoft internet explorer i get "Unknown error while working" (this message is in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.