<div dir="ltr">I&#39;m using a js file with a handful of jQuery functions wrapped in Drupal.behaviors to move, retag or alter some items on the Commerce product detail page and collection page.<div><br></div><div>The issue I have is that the final function does not fire. If I take it, replace the $&#39;s in it with jQuery and paste it in the console of firebug or chrome tools, it works just fine (it rewraps the page title).</div>
<div><br></div><div>The js contents are below. The page is: <a href="http://testing.ayendesigns.com/xooples/skincare">http://testing.ayendesigns.com/xooples/skincare</a></div><div><br></div><div><br></div><div><br></div><div>
<div>(function ($) {</div><div>  Drupal.behaviors.moveWishlist = {</div><div>    attach: function(context, settings) {</div><div>      $(&#39;&lt;div class=&quot;wish-list&quot;&gt;&lt;/div&gt;&#39;).once(&#39;moveWish&#39;, function() {</div>
<div>        $(this).appendTo(&#39;form.commerce-add-to-cart &gt; div&#39;);</div><div>        $(&#39;.node-product-display li.flag-wish_list&#39;).appendTo(&#39;ul.links&#39;);</div><div>      })</div><div>    }</div><div>
  };</div><div>  Drupal.behaviors.moveAddThis = {</div><div>    attach: function(context, settings) {</div><div>      $(&#39;&lt;li class=&quot;addthis&quot;&gt;&lt;/li&gt;&#39;).once(&#39;addthis1&#39;).appendTo(&#39;.node-product-display ul.links&#39;);</div>
<div>      $(&quot;.node-product-display a[href^=&#39;<a href="http://www.addthis">http://www.addthis</a>&#39;]&quot;).once(&#39;addthis2&#39;).appendTo(&#39;li.addthis&#39;);</div><div>    }</div><div>  };</div><div>  Drupal.behaviors.moveLinks = {</div>
<div>    attach: function(context, settings) {</div><div>      $(&#39;.node-product-display .group-right ul.links&#39;).once(&#39;addthislinks&#39;).appendTo(&#39;.node-product-display div#tabs&#39;);</div><div>    }</div>
<div>  };</div><div>  Drupal.behaviors.moveTrending = {</div><div>    attach: function(context, settings) {</div><div>      $(&#39;li.flag-trending&#39;).once(&#39;moveTrending&#39;).appendTo(&#39;.node-product-display ul.links&#39;);</div>
<div>    }</div><div>  };</div><div>  Drupal.behaviors.titleTag = {</div><div>    attach: function(context, settings) {</div><div>        $(&#39;body.page-node header&#39;).find(&#39;h2&#39;).once(&#39;titleTag&#39;).replaceWith(function() {</div>
<div>            return &#39;&lt;h1 class=&quot;field-name-title-field&quot;&gt;&#39; + $(this).text() + &#39;&lt;/h1&gt;&#39;;</div><div>        });</div><div>    }</div><div>  };</div><div>  Drupal.behaviors.categoryPage = {</div>
<div>    attach: function(context, settings) {</div><div>      $(&#39;.page-product-category .view-display-id-page&#39;).once(&#39;categoryPage&#39;, function() {$(this).find(&#39;div.taxonomy-title&#39;).replaceWith(function() {</div>
<div>          return &#39;&lt;h1 class=&quot;taxonomy-title&quot;&gt;&lt;span&gt;&#39; + $(this).text() + &#39;&lt;/span&gt;&lt;/h1&gt;&#39;;</div><div>        });</div><div>    })}</div><div>  };</div><div> })(jQuery);</div>
<div><br></div><div><br></div>-- <br>---<div><a href="http://drupal.org/user/367108" target="_blank">drupal.org/user/367108</a></div><div><a href="http://linkedin.com/in/jeffrgreenberg" target="_blank">linkedin.com/in/jeffrgreenberg</a></div>
<div><a href="http://accidentalcoder.com" target="_blank">accidentalcoder.com</a> / <a href="http://ayendesigns.com" target="_blank">ayendesigns.com</a></div><div>@accidentalcoder</div>
</div></div>