From 61b17b4c023776386e077f0abac6a7dfb4f0b353 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 5 Feb 2009 07:10:11 +0000 Subject: [PATCH] Facebook app: don't add FBJS event listeners to notice input box if it's not on the page --- js/facebookapp.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/facebookapp.js b/js/facebookapp.js index 8ef9aa532b..f0696c19e9 100644 --- a/js/facebookapp.js +++ b/js/facebookapp.js @@ -19,10 +19,12 @@ var max = 140; var noticeBox = document.getElementById('notice_data-text'); -noticeBox.addEventListener('keyup', keypress); -noticeBox.addEventListener('keydown', keypress); -noticeBox.addEventListener('keypress', keypress); -noticeBox.addEventListener('change', keypress); +if (noticeBox) { + noticeBox.addEventListener('keyup', keypress); + noticeBox.addEventListener('keydown', keypress); + noticeBox.addEventListener('keypress', keypress); + noticeBox.addEventListener('change', keypress); +} // Do our the countdown function keypress(evt) {