IE8&9 failing to show text file on second call

Discussion in 'HTML' started by Bob Miers, Mar 9, 2012.

  1. Bob Miers

    Bob Miers Guest

    I have a WEB index.html page that uses the following code to read and
    display a normal text file. (I found this code on the WEB)
    It works as advertised, quite well, with all of the browsers (Foxfire,
    Apple's, etc.) I've tested except with MS IE8 & IE9.

    When I access the WEB page by entering the URL in the address line, I
    see the context of the text file as desired,
    However if I navigate to any other page on the WEB site and then
    return to the Home Page (index.html), the text file
    content is not shown. My bypass is to use the "id="dsp">Check with
    one of our agents for Our Featured Listing particulars." text
    is used. (see code near the end).

    I've tried several methods to make the browser not use cache to no
    avail. ie <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

    Any ideas?

    Thanks, Bob Miers

    <!--this is the beginning of the code to read a text file
    -->
    <!-- <meta http-equiv="content-type"
    content="text/html;charset=utf-8" />
    <title>An XHTML 1.0 Strict standard template</title>
    <meta http-equiv="content-type"
    content="text/html;charset=utf-8" />
    -->
    <script type="text/javascript">
    //<![CDATA[
    var xmlhttp=false;
    /*@cc_on @*/
    /*@if (@_jscript_version >= 5)
    // JScript gives us Conditional compilation, we can cope
    with old IE versions.
    // and security blocked creation of the objects.
    try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
    alert('!IE')
    xmlhttp = false;
    }
    }
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    try {
    xmlhttp = new XMLHttpRequest();
    } catch (e) {
    xmlhttp=false;
    }
    }
    if (!xmlhttp && window.createRequest) {
    try {
    xmlhttp = window.createRequest();
    } catch (e) {
    xmlhttp=false;
    }
    }
    xmlhttp.open("GET","featured.txt" ,true);
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
    document.getElementById('dsp').innerHTML=xmlhttp.responseText;
    }
    }
    xmlhttp.send(null)
    //]]>
    </script>
    <!--</head>-->
    <!--<body>-->
    <div>
    <div>
    <p align="justify" id="dsp">Check with one of our agents
    for Our Featured Listing particulars.</p>
    </div>
    </div>
     
    Bob Miers, Mar 9, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neil Gould

    IE8 failing with some ASP code...

    Neil Gould, Apr 3, 2009, in forum: ASP General
    Replies:
    1
    Views:
    150
    Neil Gould
    Apr 3, 2009
  2. Raymond O'Connor
    Replies:
    1
    Views:
    151
    Raymond O'Connor
    Mar 8, 2007
  3. yelipolok
    Replies:
    4
    Views:
    273
    John W. Krahn
    Jan 27, 2010
  4. Evertjan.
    Replies:
    3
    Views:
    86
    Laurent vilday
    Mar 5, 2008
  5. cecile

    ie8!=ie8

    cecile, May 24, 2010, in forum: Javascript
    Replies:
    2
    Views:
    197
    David Mark
    May 24, 2010
Loading...

Share This Page