javascript - Having issues using a scope in Jquery -
so i'm trying pass freemarker variable value (${item.uid}) on click of link in order launch modal same unique id value.
although functions can access value of uid
, when run $('body').append($('div.disclaimer' + outervar).remove());
outervar
shows undefined
.
javascript
var outervar = uid; $('body').append($('div.disclaimer' + outervar).remove()); function showdisclaimer(uid) { var x = uid; $('div.disclaimer' + x).show(); } function closedisclaimer(uid) { var x = uid; // clear form , close modal $('div.disclaimer' + x).hide(); }
html
<a onclick="showmodal('${item.uid}')">call function</a> <div class="modal${item.uid}" style="display:none;"> <div class="content"> test content here </div> </div>
Comments
Post a Comment