Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic table and image cache

Status
Not open for further replies.

BKQc

Programmer
Jul 26, 2002
118
CA
I'm trying to build a table dynamically using JS for IE6.0 that contains images and text. In fact, every image referenced in the table has the same exact URL. The problem is that IE will do as many calls to the web server has there are images even though they all point to the same place.

I tried to save the rendered page as an HTML file and then open the file directly and in this case, there is only one call done to the server.

What is the difference between dynamic and static image URL parsing? Is there any way of having IE use its cache when using dynamic HTML?

To build my table, I'm using something like
Code:
var oTable = document.createElement("<table class='tabContent'>");

var oTable2= document.createElement("<table class='Inter'>");
var oTR	= oTable2.insertRow();
var oCell = oTR.insertCell();
oTable.actionsCell = oCell;
oTable.actionsCell.innerHTML = 
"<a href='javascript:void(0);' onclick='this.parentElement.refObject.enterEditMode()'>" + 
"<img src='" + _globals.imagesPath + "bt_ico-modifier-off.jpg' hoverSrc='" + _globals.imagesPath + "bt_ico-modifier-rol.jpg' alt=\"Modifier l'intervention\" class='rollOver'></a>";

oTable.insertRow(0).insertCell().appendChild(oTable2)

document.body.appendChild(oTable);

Thank you very much fo your help as this bug is slowing down rendering extremely.
 
what about styling a certain anchor class with the background image, and then simply applying the class to the anchor?

something like this:

Code:
.hasImage {
    background: #fff url(path/to/img.gif) no-repeat center center;
    display: block;
    width: 100%;
}

and then:

Code:
oTable.actionsCell.innerHTML =
"<a [red]class='hasImage' [/red]href='javascript:void(0);' onclick='this.parentElement.refObject.enterEditMode()'></a>";

note: i haven't tested this...



*cLFlaVA
----------------------------
[tt]mr. pibb + red vines = crazy delicious![/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top