From 05aa187f0a92e95d82225134cf18964afbfd6002 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Mon, 22 Sep 2014 16:44:18 +0200 Subject: [PATCH] Fix relative path issue --- tarteaucitron.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 91ab28f..3a0df98 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1,6 +1,12 @@ /*jslint browser: true */ + +// define correct path for files inclusion +var scripts = document.getElementsByTagName('script'), + path = scripts[scripts.length - 1].src.split('?')[0], + cdn = path.split('/').slice(0, -1).join('/') + '/'; + var tarteaucitron = { - "cdn": "", + "cdn": cdn, "user": {}, "lang": {}, "services": {},