我确实有一个列表a Culture和一个翻译列表:
public class Translation
{
public string key { get; set; }
public string value { get; set; }
public string cultureId { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
public async Task<IActionResult> ReactGetResources(string module = "shared")
{
string[] Languages = { "en-US", "fr-FR", "it-IT", "es-ES" };
List<Translation> Translation = new List<Translation>();
Translation.Add(new Translation { key = "hello", value = "Hello", cultureId = "en-US" });
Translation.Add(new Translation { key = "hello", value = "Bonjour", cultureId = "fr-FR" });
Translation.Add(new Translation { …Run Code Online (Sandbox Code Playgroud) <ins id="widget"
style=""
data-lang="fr"
data-city-id="669"
data-font-color="000000"
data-background-color="ffffff"
data-border-color="c0c0c0"
data-datetime-color="000000"
data-input-background="ffffff"
data-next-background="d8d8d8">
</ins>
<textarea id="the-code"></textarea>
<button type="button" id="get-code">Get the code</button>
Run Code Online (Sandbox Code Playgroud)
我试图用Jquery克隆ins元素到textarea
$("#get-code").on("click", function () {
var clone = $("#widget").clone();
$("#the-code").val(clone);
});
Run Code Online (Sandbox Code Playgroud)
克隆的内容[object Object]在textarea中返回,而不是html代码< ins >
示例: FIDDLE