Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Included html not showing latest version. How can I get the including page to show the updated include.?

I can get the code to work initially however if I change the text in alert.htm the changes are not reflected in a refreshed version of the outer page. 

Sample Code:

Included File (alert.htm):

<body>

<div id="alert">

<p id="text">

<!-- Start message here -->

test #3

<!-- End message here -->

</p>

</div>

</body>

Including outer html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona...

<html xmlns="http://www.w3.org/1999/xhtml%22%3E

<head>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

<meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/>

<meta http-equiv="Pragma" content="no-cache"/>

<meta http-equiv="Expires" content="-1"/>

<title>Untitled 1</title>

</head>

<body>

<h1>Test Alert</h1>

<!--webbot bot="Include" TAG="BODY" U-Include="alert.htm" startspan -->

<script type="text/javascript">

 var tag = document.getElementById("text");

 var length = tag.innerText.length;

 if(length==0) {

  var text = document.getElementById("alert").style.display = "none";

  alert('hidden');

 }

 else {

  alert(length);

 }

</script>

</body>

</html>

Update:

This code works fine when I test locally but does not work when uploaded to the server. 

1 Answer

Relevance
  • keerok
    Lv 7
    1 year ago

    Try uploading to the server with a different filename. See if it works. If it does, the server (or proxy) may be using a very persistent cache system. Don't worry. The old file should work in the morning when cache contents are flushed.

Still have questions? Get your answers by asking now.