Web Analytics Made Easy -
StatCounter File to string - CodingForum

Announcement

Collapse
No announcement yet.

File to string

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File to string

    I know there is a script here that turns a file into a string but can it work for things outside the server it was run on. I was using
    <script>
    function getFile(filename)
    { oxmlhttp = null;
    try
    { oxmlhttp = new XMLHttpRequest();
    oxmlhttp.overrideMimeType("text/xml");
    }
    catch(e)
    { try
    { oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    { return null;
    }
    }
    if(!oxmlhttp) return null;
    try
    { oxmlhttp.open("GET",filename,false);
    oxmlhttp.send(null);
    }
    catch(e)
    { return null;
    }
    return oxmlhttp.responseText;
    }
    </script>
    and that wouldn't work for:

    file = getFile("http://ja_squared.250free.com/pages/chatroom.pj");
    am I doing something wrong (it returns null and I put the file in the address bar and it was right) or can this not be done? Please help

  • #2
    if u call a file outside from a server from which your code originated, no browser except IE5.0 and newer will be able to catch it. i saw somewhere in manuals, so it mustve been true

    Comment


    • #3
      I think only IE5.5 allows external files to be fetched thru XMLHTTP.
      Glenn
      vBulletin Mods That Rock!

      Comment

      Working...
      X