0

コンピューターから Web サイトにテキスト ファイルを読み込もうとしています。IE では動作していますが、Chrome では動作しないようです。私はhtmlにまったく熟練していないので、どんな支援も素晴らしいでしょう!

<html>
<body>

    <div id = "content">
    </div>

    <script lang = "javascript">

    if (window.XMLHttpRequest)
    {
        xhttp=new XMLHttpRequest();
    }
    else // Internet Explorer 5/6
    { 
        xhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xhttp.open("GET","./Test.txt",false);
    xhttp.send("");
    xmlDoc=xhttp.responseText;

    document.getElementById('content').innerHTML = xmlDoc;
    </script>

</body>
</html> 
4

1 に答える 1

0

こちらのJavascriptファイルAPIの例でそれを行います

于 2013-01-15T16:36:02.327 に答える