I have this line of code that works:
<input type="hidden" name="${widgetId}_1" id="${widgetId}_1" value="Hello"/>
var result = '$request.getParameter("${widgetId}_data")';
However, my template literal seems to go blank if I change it to this:
<input type="hidden" name="SomeSampleElement" id="SomeSampleElement" value="Hello"/>
<input type="hidden" name="SomeSampleElement_data" id="SomeSampleElement_data" value="ValueData"/>
var element = $jQuery("#SomeSampleElement");
var result = '$request.getParameter("${element.id}_data")';
Element is an HTML element in this case.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…