1 Reply Latest reply: Aug 4, 2014 12:43 PM by ldapsrv RSS

    On Demand AJAX call returning Javascript


      Hi all,


      Bit of an oddity here as I have not seen an on demand process complete successfully and spit out Javascript before. Perhaps a bug? Using APEX 4.2.4.


      I've create an on demand page process on my login page that basically looks up an existing username/email combination and spits back a new randomly generated password to the user if they exist. Of course they should log on and change their password once this temp one has been sent.


      Ajax call goes off without a hitch. My response is returned as expected via a htp.p in the page process and the email/password generation and hash all go off as expected. No exceptions are thrown. The issue is I'm getting the following Javascript returned from the AJAX call within the wwv_flow_show response:


      {"msg":"Successfully sent credentials to selected email."}

      <script type="text/javascript">



      var lTimeoutField = document.getElementById("apex_login_throttle_sec"),

          lTimeout      = lTimeoutField ? +lTimeoutField.innerHTML : 0;

      if (lTimeout) {

          var lTimer = window.setInterval (

              function() {

                  if (lTimeout > 0) {

                      lTimeoutField.innerHTML = lTimeout;


                  } else {


                      var lDiv = document.getElementById("apex_login_throttle_div");

                      if (lDiv) {


                          return true;




              1000 );







      Call to page process:


      apex.server.process ('P101_PRC_REQUEST_CREDENTIALS',

                          {pageItems : '[id^=P101_APP_USERS]'},


                          dataType  : 'text',

                          async      : false,

                          success   : function(pData) {

                                          var $jsonResult = JSON.parse(pData);

                                          if(!$jsonResult.error) {

                                              $('#responseMessage').css('background-color', 'green')



                                          } else {

                                              $('#responseMessage').css('background-color', 'red')







      Has anyone seen this behavior?