WinJS loading local json file

后端 未结 2 1562
野性不改
野性不改 2021-01-13 12:08

I am banging my head on this one.

I cannot find a way to open a simple json file from a subfolder in my WinJS App.

I have tried Ajax and WinJS.xhr, both to n

2条回答
  •  有刺的猬
    2021-01-13 12:40

    If the data is part of your project, and you have marked the project type as Content, then

    WinJS.xhr({ url: "data/mydata.txt" }).then(...)
    

    works for me. Assumes in this example that mydata.txt is in a folder inside your project named data

提交回复
热议问题