View Full Version : Working with a Variable in another Frame is Slower

07-16-2004, 12:04 AM
As some of you have read and helped me in other posts (same project different problems) I am now successfully 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 database I was losing the value 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. The only wild guess I can make is that after the data is loaded from the .js file to index_data it gets re-loaded into index_create to be used. That would be very poor data management... but maybe I am causing it. (Actually I think the 3 to 4 seconds is longer than it would be if that were the cause.)

Thanks for any ideas, Peter

<!-- index_food_data.html 040715 -->
<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>")}
<script language="JavaScript">
if (parent.frames[2].loaded==true){parent.create.makeImage()}

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){

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.