2016-10-12 2 views

답변

4

예, 그것은 가능하고 jQuery로 간단합니다.

$.get("www.example.com/page_b/my_file.txt", function(contents){ 
    //contents variable now contains the contents of the textfile as string 

    //check if file contains the word Hello 
    var hasString = contents.includes("Hello"); 

    //outputs true if contained, else false 
    console.log(hasString); 
}) 
: 당신은 텍스트 파일의 내용과 같이 "GET"필요

2

에 한번 사용 JQuery와 $의 갔지()

$.get("text file path",function(textString) { 
    // handle the returned string .. 
},"text/plain") 
관련 문제