peterinwa
06-23-2002, 05:01 AM
This problem only occurs when I do a Refresh to the browser window -- which I only do in testing -- so it really doesn't matter. Except to my sanity.
My hompage consists of a form with a <textarea>. Every time the a visitor returns to the homepage the text is different. Almost every time... there are five sets of text.
This works just fine when you actually leave the homepage and go to any other URL, then return. You find the new text. But if you just do a Refresh -- even a Ctrl Refresh with Internet Explorer -- you see the new text flash in the <textarea> VERY quickly and then the old text appears and stays there.
With each Refresh the text changes as it should but only flashes before the old text re-appears. Again, if you go to a new URL then return the "old text" will be changed.
Here's some code so I don't get asked for it, but I suspect the answer to this will come from someone who better understands how browsers work.
// Texts
if (brType!="MIE"){bl=" \n"} else {bl=""}
text1=bl+"1 Metric? Stones? Kilojoules? See Help";
text2=bl+"2 BMI? BMR? See our FAQs";
text3=bl+"3 See our Frequently Asked Questions (FAQs)";
text4=bl+"4 Check our our Fat Loss Tips";
text5=bl+"5 Check out Diet and Weight Loss Basics";
text=text1;
// Rotate text
if (getCookie("textNumCookie")==null){textNum=1}
else {textNum=getCookie("textNumCookie");
textNum++;
if (textNum > numTexts) textNum=1}
saveCookie1y("textNumCookie",textNum,X1y);
if (textNum==1){text=text1}
if (textNum==2){text=text2}
if (textNum==3){text=text3}
if (textNum==4){text=text4}
if (textNum==5){text=text5}
// Results panel
c+="<tr><td align=center colspan=3>";
c+="<textarea name=results border=1 cols=48 rows="+High+">"+text+"</textarea>";
c+="</td></tr>";
My hompage consists of a form with a <textarea>. Every time the a visitor returns to the homepage the text is different. Almost every time... there are five sets of text.
This works just fine when you actually leave the homepage and go to any other URL, then return. You find the new text. But if you just do a Refresh -- even a Ctrl Refresh with Internet Explorer -- you see the new text flash in the <textarea> VERY quickly and then the old text appears and stays there.
With each Refresh the text changes as it should but only flashes before the old text re-appears. Again, if you go to a new URL then return the "old text" will be changed.
Here's some code so I don't get asked for it, but I suspect the answer to this will come from someone who better understands how browsers work.
// Texts
if (brType!="MIE"){bl=" \n"} else {bl=""}
text1=bl+"1 Metric? Stones? Kilojoules? See Help";
text2=bl+"2 BMI? BMR? See our FAQs";
text3=bl+"3 See our Frequently Asked Questions (FAQs)";
text4=bl+"4 Check our our Fat Loss Tips";
text5=bl+"5 Check out Diet and Weight Loss Basics";
text=text1;
// Rotate text
if (getCookie("textNumCookie")==null){textNum=1}
else {textNum=getCookie("textNumCookie");
textNum++;
if (textNum > numTexts) textNum=1}
saveCookie1y("textNumCookie",textNum,X1y);
if (textNum==1){text=text1}
if (textNum==2){text=text2}
if (textNum==3){text=text3}
if (textNum==4){text=text4}
if (textNum==5){text=text5}
// Results panel
c+="<tr><td align=center colspan=3>";
c+="<textarea name=results border=1 cols=48 rows="+High+">"+text+"</textarea>";
c+="</td></tr>";