Javascript 如何上传&;查看json文件以便稍后在Ionic 3中获取其数据?
我有一个小的json,我想在上传到我的网站后使用数据Javascript 如何上传&;查看json文件以便稍后在Ionic 3中获取其数据?,javascript,json,ionic-framework,ionic3,Javascript,Json,Ionic Framework,Ionic3,我有一个小的json,我想在上传到我的网站后使用数据 { "Images" : { "url": [ "https://images4.alphacoders.com/474/thumb-1920-47438.png", "https://images7.alphacoders.com/303/thumb-1920-303042.png" ] } } 我的问题是:当我上传file.json时,我只能下载它 编辑: 为了让
{
"Images" : {
"url":
[
"https://images4.alphacoders.com/474/thumb-1920-47438.png",
"https://images7.alphacoders.com/303/thumb-1920-303042.png"
]
}
}
我的问题是:当我上传file.json时,我只能下载它
编辑:
为了让我的问题更清楚,我在临时站点上传了json文件
那么,可以从第一个链接获取json吗 我很久以前就搜索过类似的东西,所以不记得我搜索了什么,但下面是帮助我尝试这段代码的示例
$.ajax({
url: yourUrl,
type: "GET",
dataType: "json",
data: null,
success: function (response) {
console.log("RESULT:" + JSON.stringify(response));
var json = JSON.parse(response);
},
error: function (response) {
console.log("ERROR:" + JSON.stringify(response));
}
});
任何人都能帮上忙@Suraj RaoI编辑了这个问题,你现在可以@Alon Eitan检查它
$.ajax({
url: yourUrl,
type: "GET",
dataType: "json",
data: null,
success: function (response) {
console.log("RESULT:" + JSON.stringify(response));
var json = JSON.parse(response);
},
error: function (response) {
console.log("ERROR:" + JSON.stringify(response));
}
});