How to use JQuery to POST, retrieve result, and use result to set an object property
<p>I've embedded a visualization into an HTML page using the script below. Essentially, I set the properties on an object which represents the visualization, and then viz_v1.js does all the heavy lifting for me:</p>

<pre><code>  &lt;script type="text/javascript" src="http://public.tableausoftware.com/javascripts/api/viz_v1.js"&gt;&lt;/script&gt;
  &lt;div class="tableauPlaceholder" 
        style="width:654px; height:1469px;background-image: url('http://localhost:81/Background.gif'); top: 0px; left: 0px; width: 100%; margin-left: 76px;"&gt;

            &lt;noscript&gt;
                &lt;a href="#"&gt;&lt;img alt="Analytics, Inc. " 
                src="http://localhost:81/Background.gif" 
                style="border: none" /&gt;&lt;/a&gt;
            &lt;/noscript&gt;

            &lt;object class="tableauViz" width="654" height="1469" style="display:none;"&gt;
            &lt;param name="host_url" value="http%3A%2F%2F192.168.56.1%2F" /&gt;
            &lt;param name="site_root" value="/t/Site2" /&gt;
            &lt;param name="name" value="AnalyticsIncJavaScript&amp;#47;AnalyticsInc" /&gt;
            &lt;param name="tabs" value="no" /&gt;
            &lt;param name="toolbar" value="yes" /&gt;
            &lt;param name="static_image" value="Background.gif"/&gt;
            &lt;param name="animate_transition" value="yes" /&gt;
            &lt;param name="display_static_image" value="yes" /&gt;
            &lt;param name="display_spinner" value="yes" /&gt;
            &lt;param name="display_overlay" value="yes" /&gt;
            &lt;param name="display_count" value="yes" /&gt;
            &lt;/object&gt;

    &lt;/div&gt;
</code></pre>

<p>Note that I'm hard-coding all the property values in question. </p>

<p>I now need to add another parameter/property into the mix - and the value of this sucker needs to be dynamic:</p>

<pre><code>        &lt;object class="tableauViz" width="654" height="1469" style="display:none;"&gt;
        &lt;param name="host_url" value="http%3A%2F%2F192.168.56.1%2F" /&gt;
        ... 
        &lt;param name="ticket" value="&lt;a dynamic value&gt;" /&gt;           
        &lt;/object&gt;
</code></pre>

<p>I must retrieve the value for "ticket" by POSTing an arbitrary username and the IP of the client to a URL, then grab the response. </p>

<p>From the research I've done, it looks like jquery will allow me to do this, but since I'm a js newb, I'm unclear how to pass TWO name/value pairs (username, ipaddress) when I POST. I'm also unclear how to grab the resulting "ticket" value by parsing the response and drop it into a variable for use later on. </p>

<p><strong>Question 1:</strong> Can someone show me how to do this? ("Keep it simple for stupid" is defintely in order here - an assumption that I am clueless about jquery and javascript would be correct)</p>

<p><strong>Question 2:</strong> Assuming I've now gotten my ticket value loaded into a variable (let's call it varTicket), how do I dynamically populate the ticket parameter on my tableauViz object? </p>

<p>Do I use something like PHP (clueless about that, too), and somehow ECHO my ticket value in? Can I address the tableauViz object directly and touch it's .ticket property? I'd prefer to handle this part of the puzzle without having to reload/submit the containing page. </p>

<p>Thanks for your ideas!</p>
