I have a javascript timer set to fire every 2.5 seconds so that I can set the current values for the items and total for the shopping cart summary.  I would like to be able to get these values from client side cookies or javascript global variables so that I don&#39;t have to make an ajax call to the server but I have found that the DOM elements are not accessible within the javascript function unless I run an ajax request to a page (listed below) and after it returns then the DOM elements are accessible (i.e. $(&quot;.num-items&quot;).html(numItems);) and now I can update them.  Having these ajax requests run every 2.5 seconds for every client will not scale.<br>
<br>How can I make Drupal DOM elements accessible within a javascript function without having to do an ajax request to a page?<br><br>Thanks,<br><br>John<br><br>    setInterval(&#39;updateShoppingCartInfo()&#39;, 2500);<br>
<br>    function updateShoppingCartInfo(){<br>        var xmlHttpReq = new XMLHttpRequest();<br>        var url = &#39;https://&#39; + document.domain + &#39;/cart/refreshcarttimer&#39;;<br>        xmlHttpReq.open(&#39;post&#39;, url, true);<br>
        xmlHttpReq.onreadystatechange = function() {<br>               if (xmlHttpReq.readyState != 4)  { <br>                   return; <br>               }<br>            else {<br>                var responseText = xmlHttpReq.responseText;<br>
                                var numItems = responseText.substr(0,responseText.indexOf(&quot;,&quot;));<br>                                var ucPrice = responseText.substr(responseText.indexOf(&quot;,&quot;)+1);<br>                                $(&quot;.num-items&quot;).html(numItems);<br>
                                $(&quot;.uc-price&quot;).html(ucPrice);<br>            }               <br>        }<br>        xmlHttpReq.send(null);<br>    }     <br><br clear="all"><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup">
</div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>-- <br>
John J. Mitchell<br>