瀏覽代碼

simplify query match

Hakim El Hattab 12 年之前
父節點
當前提交
a6969770bd
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      lib/slidenotes/client.js

+ 1 - 2
lib/slidenotes/client.js

@@ -1,7 +1,6 @@
 (function() {
 	// don't emit events from inside the previews themselves
-	var qs = window.location.href.split('?');
-	if (qs.length > 1 && qs[1].match('receiver')) { return; }
+	if ( window.location.search.match( /receiver/gi ) ) { return; }
 
 	var socket = io.connect(window.location.origin);
 	var socketId = Math.random().toString().slice(2);