Reputation: 3022
I need to map an ISO country code in the data, to an associated flag icon in javascript.
However, this syntax isn't working. How do I use #APP_IMAGES# in a javascript function to get a handle to an image.
var country = {
"id": isoCode,
"name": covidData[i].COUNTRY_ALTERNATIVE_NAME,
"value": 50, // not used, dummy value
"status": covidData[i].STATUS,
"fill": chartColors.general,
"longitude": covidData[i].LONGITUDE,
"latitude": covidData[i].LATITUDE,
"covax": covidData[i].COVAX_SUPPLY,
"covax_approved": covidData[i].COVAX_APPROVED,
"mah": covidData[i].MAH,
"drug_product_supply": covidData[i].DRUG_PRODUCT_SUPPLY,
"drug_substance_supply": covidData[i].DRUG_SUBSTANCE_SUPPLY,
"packing_release" : covidData[i].PACKING_RELEASE,
"ema": covidData[i].EMA_FLAG,
"flag": "#APP_IMAGES#" + isoCode + ".png"
};
The focus is on this:
"flag": "#APP_IMAGES#" + isoCode + ".png"
I have tried "&AP_IMAGES.", and just a console log of this is giving me:
ariel/r/149/files/static/v289/
Upvotes: 0
Views: 516
Reputation: 15094
I believe the correct syntax is &APP_IMAGES.
. Where is your JavaScript code? If it's in an external file, the substitution will not be made.
Upvotes: 1