简体   繁体   English

在通话成功后重现数据,ajax?

[英]returing data after the call success, ajax?

'function makeRequest() 
 {
var G_REL_URL="'||owa_util.get_cgi_env('SCRIPT_NAME')||'" 
   var v_data_sales ={ pvCurrCd:"'||CURRDEF||'"
            };       
 $.ajax({
 url:G_REL_URL+ "/contr_entry_pkg.SELECT_SALES_CENTERS",
 data:v_data_sales,
 async:false,        
success: function(vRetVal){
  //var jsonObj =  eval("("+vRetVal+")");
function processresponse(v_data_sales,vRetVal)

               }

               });
          } '||CHR(10)||     
       'function processresponse (v_data_sales,vRetVal){
retJson=eval("("+vRetVal+")");
} '; 

i want to return a data to a dropdown after there is a onchange='makeRequest" im not sure if im doing it the right way but is not giving me any errors and is not working maybe my logic is wrong but after its success if calls the function processresponse so it will return pvcurrcd but its not doing it. any help or tips ,thanks 我想在有onchange ='makeRequest“之后将数据返回到下拉列表,我不确定即时消息是否以正确的方式执行,但是没有给我任何错误并且无法正常工作,也许我的逻辑是错误的,但是在调用成功后函数processresponse,所以它将返回pvcurrcd,但它没有执行任何帮助或提示,谢谢

here below is where it make the onchange call which i dont think it matter here 下面是它发出onchange呼叫的地方,我认为这并不重要

 HTP.P('<td class="reqlabel1">Sales Center:</td>');
        HTP.P('<td class="tablelabel">');
         HTP.P(Get_Sc_Dd(PVNAME=>'pnSalesCenterID', PVORAID=> VUSERNAME, 
PVDEFVAL => NSALESCENTERID, PVEVENT=>'class="reqinput1" onChange="makeRequest();" style="width:260px"'));

it will change the currency dropdown here 它将更改此处的货币下拉列表

    HTP.P('<td class="reqlabel1">Currency:</td>');
        HTP.P('<td class="tablelabel">');
         HTP.P(Get_Currency_Dd(PVNAME=>'pvCurrCd', PVDEFVAL => NULL, 
PVEVENT=>'class="reqinput1" id="pvCurrDd" onblur="makeRequest();"  style="width:200px"'));

your code is missing some correct syntax... try this 您的代码缺少一些正确的语法...试试这个

'function makeRequest(){
        var G_REL_URL="'||owa_util.get_cgi_env('SCRIPT_NAME')||'";
        var v_data_sales ={ pvCurrCd:"'||CURRDEF||'"         };       
        $.ajax({
            url:G_REL_URL+ "/contr_entry_pkg.SELECT_SALES_CENTERS",
            data:v_data_sales,
            async:false,        
            success: function(vRetVal){
                //var jsonObj =  eval("("+vRetVal+")");
                            /*
                                fire up the Javascript console in 
                                chrome/firefox/safari
                                and look at the result of:
                            */
                            console.log(vRetVal);
                            // or better:
                            console.dir(vRetVal);

                processresponse(v_data_sales,vRetVal);
            }
        });
        function processresponse(v_data_sales,vRetVal){
            retJson=eval("("+vRetVal+")");
        }
 }'; 

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

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