diff --git a/js/display_editor.js b/js/display_editor.js
index 53274f6..a84cea4 100644
--- a/js/display_editor.js
+++ b/js/display_editor.js
@@ -87,7 +87,7 @@ Drupal.Panels.Draggable = {
   unsetDropZone: function() {
     $(this.current_dropzone.obj).removeClass(this.hoverclass);
     this.current_dropzone = null;
-    for (var i in this.landing_pads) {
+    for (var i = 0; i < this.landing_pads.length; i++) {
       $(this.landing_pads[i].obj).remove();
     }
     this.landing_pads = [];
@@ -131,7 +131,7 @@ Drupal.Panels.Draggable = {
   },
 
   reCalculateDropZones: function() {
-    for (var i in this.dropzones) {
+    for (var i = 0; i < this.dropzones.length; i++) {
       var offset = $(this.dropzones[i].obj).offset();
       offset.width = $(this.dropzones[i].obj).outerWidth();
       offset.height = $(this.dropzones[i].obj).outerHeight();
@@ -164,7 +164,7 @@ Drupal.Panels.Draggable = {
     var shortest_distance = null;
     var nearest_pad = null;
     // find the nearest pad.
-    for (var i in this.landing_pads) {
+    for (var i = 0; i < this.landing_pads.length; i++) {
       // This isn't the real distance, this is the square of the
       // distance -- no point in spending processing time on
       // sqrt.
@@ -188,7 +188,7 @@ Drupal.Panels.Draggable = {
   findDropZone: function(x, y) {
     // Go through our dropzones and see if we're over one.
     var new_dropzone = null;
-    for (var i in this.dropzones) {
+    for (var i = 0; i < this.dropzones.length; i++) {
 //      console.log('x:' + x + ' left:' + this.dropzones[i].left + ' right: ' + this.dropzones[i].left + this.dropzones[i].width);
       if (this.dropzones[i].left < x &&
         x < this.dropzones[i].left + this.dropzones[i].width &&
diff --git a/panels_ipe/js/panels_ipe.js b/panels_ipe/js/panels_ipe.js
index f6cae92..2ae0c41 100644
--- a/panels_ipe/js/panels_ipe.js
+++ b/panels_ipe/js/panels_ipe.js
@@ -37,7 +37,7 @@ Drupal.behaviors.PanelsIPE = {
     }
 
     // Initialize new editors.
-    for (var i in Drupal.settings.PanelsIPECacheKeys) {
+    for (var i = 0; i < Drupal.settings.PanelsIPECacheKeys.length; i++) {
       var key = Drupal.settings.PanelsIPECacheKeys[i];
       $('div#panels-ipe-display-' + key + ':not(.panels-ipe-processed)')
         .addClass('panels-ipe-processed')
