title: URL in AJAX call
body: <p>I am persisting the data in a textbox before redirecting the page to another. When the user clicks the back button in the page load function of the page (in javascript) I am getting the data from the textbox like</p>
  
  <pre><code>var pageval = $('#grid')
   .load('/Dealer/AllClaims?page=5&amp;__=634673230919806673 #grid', CallBackFunction);
  </code></pre>
  
  <p>I want to send an AJAX call by using the URL from the above data. I.e from <code>/Dealer/AllClaims?page=5&amp;__=634673230919806673 #grid</code>. So I replaced the 'pageval' unnecessary data with (.replace()) in javascript. Now I store it as</p>
  
  <pre><code>var urlmain = '/Dealer/AllClaims?page=5&amp;__=634673230919806673 #grid';
  </code></pre>
  
  <p>When I send an AJAX call with this 'urlmain' like </p>
  
  <pre><code>$.ajax({
      type: "GET",
      url: urlmain,
  
      success: function (data) {
          $("#allclaimsdiv").html(data);
      },
  </code></pre>
  
  <p>it throws error like 'status not found' as the URL is like </p>
  
  <p><strong>http://localhost:46408/Dealer/%22Dealer/GetDealerClaims?page=3&amp;__=634673387913756213</strong></p>
  
  <p><code>Failed to load resource: the server responded with a status of 500 (Internal Server Error)</code></p>
  
  <p>The above bold data is there in the URL before users click on the back button. I think it is concatenating the data.</p>
  
  <p>But for testing purpose I had given directly the URL as:</p>
  
  <pre><code>$.ajax({
      type: "GET",
      url: "/Dealer/AllClaims?page=5&amp;__=634673230919806673 #grid",
  
      success: function (data) {
          $("#allclaimsdiv").html(data);
      },
  </code></pre>
  
  <p>Then it works fine.</p>
  
  <p>What is the difference between these two? Why doesn't it work?</p>