javascript - Return a variable from jquery and use in jsp -


i have jsp file contains jquery function listens onchange event of dropdown element.

..     <select id="pick">         <option value="">select one...</option>         <option value="1">1</option>         <option value="2">2</option>         <option value="3">3</option>         <option value="4">4</option>     </select>     ....    <script type="text/javascript">    $('#pick').on('change', function() {     var isclicked=false;     if($(this).val()==2){      isclicked=true;     }    });    }  </script> 

now, script in jsp code. problem want use boolean isclicked when function out of scope. learnt have set variable read off state of boolean in jquery dom . don't know how , also, don't know how use variable set in dom in jsp code. appreciated

well, can't seamlessly use client-side , server-side code interchangeably. have send stored values on network via ajax request.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -