title: How to assign a long variable in a Url
body: <p>I have an object as a variable ,so I want to assign this object as an Id my link. 
  I wrote the below code but it does not work.</p>
  
  <p>here is my code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(".rooms").each(function(index, element) {
    var policy = $(".policy").val();
    alert(policy)
   $('.search-box2').load('page.html?id=+policy+&amp;debug=true');
  
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="rooms"&gt;
  &lt;input type="text" value="{ &amp;quot;id&amp;quot; : { &amp;quot;provider&amp;quot; : { &amp;quot;provider_id&amp;quot; : &amp;quot;10&amp;quot;, &amp;quot;dmnid&amp;quot; : 2452 }, &amp;quot;NonRefundable&amp;quot; : &amp;quot;false&amp;quot;, &amp;quot;id&amp;quot; : &amp;quot;#1#c2ce302a2032435c96a0b80b8dadc5b2@63a517cd8bca4b318ae398e329509f68&amp;quot; } }" class="policy"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>