繁体   English   中英

jQuery“获取”按钮功能

[英]Jquery “get” button feature

所以这个让我感到困惑。 我有一个检索值的按钮,它起作用。 system.out(倒数第二行)中的值始终是正确的,但我永远无法获取它来填充其后的行。 之后,我可以在该行中对一些字符串进行硬编码,并且它可以工作。 我究竟做错了什么?

 b = $( "button" ).button();    
 b.click(function() {
 var request = $.ajax({
    type: 'GET',
    url:'/content-admin-webapp/contents/screening/findEntity?
    resdID=' + document.getElementById("resdID").value
    +','+document.getElementById("resdName").value,         
    dataType:"text",
    error: function (data, status, e){                          
       alert(e);}
      });
     success:
     <%      
 String  aResdName = "";
 RestrictedEntityListData foundAttribute = (RestrictedEntityListData) request.getAttribute("restrictedEntitys");             
    if (foundAttribute != null) {
      java.util.List<RestrictedEntityData> foundResds = 
      foundAttribute.getRestrictedEntys();                           
         for(RestrictedEntityData  eachFoundResds :  foundResds)
             { 
             if(foundResds.get(0) != null){ 
                         aResdName = 
   foundResds.get(0).getRestrictedEntityName(); 
                        }
                    }   
                 }  
               System.out.print(aResdName); 
             %>   
             $('#resdName').val(<%=aResdName%>); 
         });

我认为您所需要的只是围绕该值报价。

$('#resdName').val('<%=aResdName%>');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM