pass JS Objects in URL
<p>I have already searched from this question in SO. But none of the answers worked for me, so I am posting this once more in the hope to find an answer that works for me.</p>

<p>Is there a way to pass JS/JSON objects through URL? Suppose I have a JS Object like so:</p>

<pre><code>var jObj = {"color":"red","shape":"square"}
</code></pre>

<p>Now suppose I want to pass it to a URL like so:</p>

<pre><code>window.open("/process/jObj"); //here I want the var defined above to be passed
</code></pre>

<p>I tried various options like <code>JSON.stringfy</code>, <code>encodeURIComponent</code>, <code>escape</code>..but I am not able to pass it around. Any idea how this can be achieved in pure JS?</p>

<p>I would like to pass it so that in the next page (process.php) such that there I can get the values of jObj and use it for further processing. Basically I am looking for an option where I can pass the object to the effect of <code>?color=red&amp;shape=square</code> without having to squash and reformat the object too much</p>
