diff --git a/messages_extends/static/close-alerts.js b/messages_extends/static/close-alerts.js
index <HASH>..<HASH> 100644
--- a/messages_extends/static/close-alerts.js
+++ b/messages_extends/static/close-alerts.js
@@ -1,6 +1,9 @@
-$("a.close[close-href]").click(function (e) {
-        e.preventDefault();
-        $.post($(this).attr("close-href"), "", function () {
-        });
-    }
-);
+$(function() {
+    $("a.close[close-href]").click(function (e) {
+            e.preventDefault();
+            $.post($(this).attr("close-href"), "", function () {
+            });
+        }
+    );
+});
+
jQuery js need to be executed after document is ready.