2 Replies Latest reply on Mar 25, 2016 9:29 AM by 2Charlie

    How to grab query string values from jQuery Post?

    2Charlie Level 1

      I have a jQuery that sends the data via post to my proxy ColdFusion page. However, in the this page, I'm not sure how to go about retrieving those values. I tried to log the following in my CFHTTP tag:


      <cflog text="URL: #URL#" type="Information" file="CGIparameters">

      <cflog text="URL-Name: #URL.name#" type="Information" file="CGIparameters">


      But I always get this error:


      "NetworkError: 500 Complex object types...erted to simple values. - https://devbox.mysite.com/customcf/kb/proxyPost-KB.cfm"


      This is the JavaScript that's posting to the proxy page. However, I don't think there is anything wrong with the JavaScript. I tried putting static values in the CFHTTPPARAM and there is no errors. It was able to send the data to JSON API.


      1. $(function(){
      2.     $("##frmComment").submit(function(event){
      3.         event.preventDefault();
      4.         $("##submitResponse").append('<img src="../../../assets/mysite/img/ajax-loader.gif" class="progressGif">');
      5.         // Cache $form, we'll use that selector more than once
      6.         var $form=$(this);
      7.         var data = $form.serialize(); //get all the data of form
      8.         //post it
      9.         $.post(
      10.         "/customcf/kb/proxyPost-KB.cfm",
      11.         data,
      12.         //console.log(response),
      13.         function(response){
      14.             // Success callback.  Remove your progress gif, eg:
      15.             //$('body').removeClass('in-progress');
      16.             console.log(response);
      17.             // Remove the spining gif from the div
      18.             $("##submitResponse img:last-child").remove();
      19.             //Remove the feedback form
      20.             $("##frmComment").remove();
      21.             $form.fadeOut('slow', function(){
      22.                 //Add response text to the div
      23.                 $("##submitResponse").append("<h6>Thank you for your feedback.</h6>");
      24.                 $("##submitResponse").html(response).fadeIn('slow');
      25.             });
      26.         });
      27.     });
      28. })