diff --git a/src/js/modal.trigger.js b/src/js/modal.trigger.js
index <HASH>..<HASH> 100644
--- a/src/js/modal.trigger.js
+++ b/src/js/modal.trigger.js
@@ -195,6 +195,7 @@
                     that.waitTimeout = setTimeout(readyToShow, options.waittime);
                 }
 
+                var frame = document.getElementById(iframeName);
                 frame.onload = frame.onreadystatechange = function()
                 {
                     $modal.attr('ref', frame.contentWindow.location.href);
* fixed 'frame' ariable declaration in modal.trigger.js.