Forum Moderators: open

Message Too Old, No Replies

Loading Database into Another Frame Slowed Things Down

         

peterinwa

2:41 pm on Jul 17, 2004 (gmt 0)

10+ Year Member



I am now conditionally (conditional upon the contents of a cookie) loading .js files into ANOTHER frame. I did this because reloading the frame I was working in to change the .js file database I was losing the values of my variables.

It works well now except that to reload this new frame (index_data) and then re-image the visible frame (index_image) from the frame I work in (index_create) takes about 3 or 4 seconds longer. I don't see why it should take any longer.

Thanks for any ideas, Peter

<!-- index_data.html 040715 -->
<html><head>
<script language="JavaScript">
// Load .js file
if (getCookie("listNumCookie")==null){v=null} else {v=getCookie("listNumCookie")}
if (v==101){document.write("<" + "script src='misc.js'><" + "/script>")}
if (v==102){document.write("<" + "script src='dairy.js'><" + "/script>")}
etc...
</script>
</head>
<body>
<script language="JavaScript">
if (parent.frames[2].loaded==true){parent.create.makeImage()}
</script>
</body></html>

Note: makeImage() is the function in index_create that causes the page the user sees index_image to be re-drawn each time anything on the page changes, e.g., the database.

This is the routine in index_create that causes index_data to be re-loaded when the user wants to change databases:

// Function to change database
function changeList(n){
saveCookie1y("listNumCookie",n,X1y);
top.frames['data'].location.reload()}

Note: I had the call to the function makeImage() at the end of changeList(), above, but it failed so I moved it to the bottom of index_data.

peterinwa

4:24 pm on Jul 17, 2004 (gmt 0)

10+ Year Member



Upon closer examination, it is in fact slower to reload this "other" frame than to reload the one I'm working in on my fast, new laptop.

However, this new method it is actually faster on my old 1996 PC that I use most of the time.

This tells me that it has something to do with how the PC/memory caching is handling it.

However, since more and more people will be using newer PCs, the new method will still slow down my website actions.