title: Unable to parse json string in wordpress UI
body: <p>I am trying to modify Wordpress page UI. I have written a js function:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;function myfunction()
  {
      var userSettings = {"url":"\/","uid":"xyz","time":"1584212082","secure":"1"};
      alert (userSettings);
      if (window.JSON &amp;&amp; window.JSON.parse)
      {
        alert ("true");
        var auser = window.JSON.parse(userSettings);
        if (auser == null)
        {
           alert ("Yes");
        }
        else
        {  alert ("No")  }
      }
      else
      {
         alert ("false");
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>when i call this function i get the [object Object] for alert(userSettings); That means object is surely there. Then i get true message. That means window.JSON is working. After this none of the alert message is displayed.</p>
  
  <p>My main objective is to parse the json and get the uid from json string.  </p>
  
  <p>i also read this link for some help <a href="https://www.learningjquery.com/2016/12/jquery-parsejson-vs-json-parse" rel="nofollow noreferrer">https://www.learningjquery.com/2016/12/jquery-parsejson-vs-json-parse</a></p>