如何使用内部html在UI中显示位置数据响应,如果位置值为“”(空),则需要显示“选择作为输出” >> [[

问题描述 投票:0回答:1
Api响应在下面给出

[{“ productId”:928,“ hotelId”:0,“ productName”:“ Loc 5”,“ country”:“印度”,“ city”:“班加罗尔”,“ locality”:“”,“ availableRooms”:0,“ availableRateplans”:0,“状态”:false,“ hexStatus”:否,“ additionalProperties”:{}}]

Api响应在下面给出[{“ productId”:928,“ hotelId”:0,“ productName”:“ Loc 5”,“ country”:“ India”,“ city”:“ Bangalore”,“ locality”: “”,...

javascript jquery html css
1个回答
0
投票
let response = JSON.parse(*YourResponse*).locality; if(response === ""){ response = "SELECT"; } element.innerHTML += response;
© www.soinside.com 2019 - 2024. All rights reserved.