title: Get Query String Parameter from Header
body: <p>I am trying to extract a code from a header, which is a response to an ajax query. I cannot find the response in the dom document when using debugger in my javascript no output using xhr.getAllResponseHeaders. The value does not return in the url itself, only in the Query String Parameters, so I am trying to grab it from there. Is this possible?</p>
  
  <p>Here is a picture of my Google inspect (I've underlined the code I am trying to grab.)</p>
  
  <p><a href="https://i.stack.imgur.com/kGDxH.png" rel="nofollow noreferrer">Google Inspect Header / Query String Parameters</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>    $(function() {
          $(".btn.getauthzcode").click(function() {
              var frapptokenid = readCookie('iPlanetDirectoryPro');
              $.ajax({
                  url: "http://[myurl]:8181/openam/oauth2/authorize?realm=/&amp;client_id=OpenIG&amp;response_type=code&amp;redirect_uri=http://[myurl]:8181/openam&amp;scope=uma_protection&amp;save_consent=0&amp;decision=Allow",
                          type: "GET",
                          "Access-Control-Allow-Origin": "*",
                          "Access-Control-Allow-Methods": "POST, GET, PUT, DELETE, OPTIONS",
                          "Access-Control-Allow-Headers": "X-Requested-With, content-type, X-Token, x-token",
                          headers: {
                              "accept": "application/json",
                              "dataType": "jsonp",
                              "content-type": "application/json;odata=verbose",
                              "iPlanetDirectoryPro": frapptokenid,
  
                          },
                  success: function(data, status, xhr, url) {
                      debugger
                      console.log(url);
                      console.log(xhr.getAllResponseHeaders());
                  )},
                  failure: function(data) {
                      console.log(data);
                  }
              });
          });
      });
  </code></pre>