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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -