diff --git a/src/echo.js b/src/echo.js index 62688ba..9a1bb97 100644 --- a/src/echo.js +++ b/src/echo.js @@ -29,8 +29,8 @@ window.Echo = (function (window, document, undefined) { var opts = obj || {}; offset = opts.offset || 0; throttle = opts.throttle || 250; - domElement = opts.domElement ? document.querySelector( opts.domElement ) : window; - var nodes = document.querySelectorAll( opts.domElement + ' [data-echo]'); + domElement = opts.domElement ? document.querySelector(opts.domElement) : window; + var nodes = document.querySelectorAll( (opts.domElement || "") + ' [data-echo]'); for (var i = 0; i < nodes.length; i++) { store.push(nodes[i]);