Skip to content

Node.js based forum software built for the modern web

prevent scripts in tpls from being executed more than once

psychobunnyfaa3924734f1
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index 0e881f0da2..59263bbd70 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -8,6 +8,7 @@ var ajaxify = {};
content = null;
var current_state = null;
+ var executed = {};
ajaxify.go = function(url, callback) {
var url = url.replace(/\/$/, "");
@@ -22,7 +23,10 @@ var ajaxify = {};
jQuery('#content, #footer').fadeOut(150, function() {
//content.innerHTML = templates[tpl_url];
load_template(function() {
- exec_body_scripts(content);
+ if (executed[url] !== true) {
+ exec_body_scripts(content);
+ executed[url] = true;
+ }
ajaxify.enable();
if (callback) {