'jquery variable to use in templates
I have code like below.
{{lko}}, {{lja}}, {{len}} in html file Using this will yield no results. Can you tell me how to fix it?
{{#lko}}안녕{{/lko}}{{#lja}}今日は{{/lja}}{{#len}}Hello{{/len}} I want to use it in this form.
I'm sorry my English is bad.
function getLanguage() {
return navigator.language || navigator.userLanguage;
}
jQuery("#wpsc-nft-items-container").html(jQuery("#wpsc-nft-items-container").html() + wpscMustacheRender("nft-my-items-card", {
id: "#" + element.nft.nft_id,
nftid: element.nft.nft_id,
author: element.nft.attributes[0].value,
author_external_url: element.nft.author_external_url,
author_avatar: element.nft.author_avatar,
author_account: element.nft.author_account,
author_account_link: jQuery("#wpsc-nft-etherscan").val() + "address/" + element.nft.author_account,
nft_account_link: jQuery("#wpsc-nft-etherscan").val() + "token/" + contract.contract + "?a=" + element.nft.nft_id,
author_account_short: shortify(element.nft.author_account),
title: element.nft.name,
description: element.nft.description,
category: find1stCat(element.nft.attributes),
category_link: find1stCatLink(element.nft.attributes),
media: displayMedia(element.media_type, element.json, getMediaURLs(element)),
mediaclass: element.media_type == "image" ? "" : "noImage",
tags: findAttrs(element.nft.attributes),
url: element.nft.external_url,
price: ret.amount,
price_label: ret.label,
lko: if(getLanguage() === 'ko-KR' || getLanguage() === 'kr'){"ko"},
lja: if(getLanguage() === 'ja-JA' || getLanguage() === 'ja'){"ja"},
len: if(getLanguage() === 'en-US' || getLanguage() === 'en'){""}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
