title: How to toggle JQuery .$post url
body: <p>In my program i have written the jquery like below:</p>
  
  <pre><code>$(document).ready(function() {
      $("#toggle").click(function() {
          $.post("/project/addhighlight", {
              name: "Donald Duck",
              city: "Duckburg"
          },
          function(data, status){
              var dataconverted = jQuery.parseJSON(data);
              $("#mytext").text(dataconverted);
              if (status == "success") { }
          });
      });
  })
  </code></pre>
  
  <p>What i want to do is to change the <code>$.post</code> url(<code>/project/addhighlight</code>) to the one returned by the backend method once the post is success.</p>
  
  <p>Can any one please advice on how to do it?</p>