Error replacing result obtained from json.
Json
{
"countries": "United States of America"
}
With this code I get the value of "countries"
"countries" == e && ($('input[name=" +key+ "]').val(o),
$('#countries input').val(o),
$("#new-tag-" + Xcountry).val(o)),
Result
United States of America
So far the code works perfectly for me, what I tried is that when finding "United States of America" in the Json, I replaced it with "USA"
"countries" == e && ($('input[name=" +key+ "]').val(o),
(o += t.name),
"United States of America" === t.name ? (o = "USA, ") : "United Kingdom" === t.name && (o = "UK, "),
$('#countries input').val(o),
$("#new-tag-" + Xcountry).val(o)),
This is where it gives me an error.
Try to find "United States of America" and replace it with "USA"