I am using the hook_cart_item in order to perform some javascript after an item has been added to the shopping cart. It appears to be called multiple times for just one "add to cart" click (i.e. if have 1 item in the shopping cart then hook is called 5 times and 2 items it is called 10 times) and I only want to run this javascript once. I have set it up so that the javascript is only called during the first time that this hook is executed but I have found that the javascript is not executed for this first iteration but instead is executed during a later iteration, and that it only executed once for each item within the shopping cart.<br>
<br>My question is how can I tell from the returned value (i.e. drupal_add_js('shoppingCartInfo()', 'inline')) whether this javascript has been successful called so that I can stop the call to this javascript function the next time the hook is executed?<br>
<br>Thanks,<br><br>John<br clear="all"><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>
-- <br>John J. Mitchell<br>