diff --git a/js/panels_ajax_tab.js b/js/panels_ajax_tab.js
index c547781..4edffa5 100644
--- a/js/panels_ajax_tab.js
+++ b/js/panels_ajax_tab.js
@@ -41,7 +41,10 @@
           else {
             currentTab = tabs.filter('*[data-panel-name="' + preloaded + '"]');
             // Prime the cache from the preloaded content
-            currentTab.data('panels-ajax-tab-cache', $('#panels-ajax-tab-container-' + target_id).html());
+            var $tempCurrentTab = $('#panels-ajax-tab-container-' + target_id).clone();
+            $tempCurrentTab.find('*').removeClass('ajax-processed');
+            currentTab.data('panels-ajax-tab-cache', $tempCurrentTab.html());
+            $tempCurrentTab.remove();
           }
           
           currentTab.addClass('panels-ajax-tabs-first-loaded');
@@ -110,9 +113,12 @@
             $('#panels-ajax-tab-container-' + target_id).html(data);
             Drupal.attachBehaviors($('#panels-ajax-tab-container-' + target_id)[0]);
             $(container).data('loading', false);
-            
+
             // Cache the contents
-            $tab.data('panels-ajax-tab-cache', $('#panels-ajax-tab-container-' + target_id).html());
+            var $tempTab = $('#panels-ajax-tab-container-' + target_id).clone();
+            $tempTab.find('*').removeClass('ajax-processed');
+            $tab.data('panels-ajax-tab-cache', $tempTab.html());
+            $tempTab.remove();
 
             // Trigger optional callback
             if (callback) {
