From e8d2044162dd905a396421e82daea00b3fd9e4f8 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Tue, 17 Oct 2023 10:40:43 +0200 Subject: [PATCH] Only add the id if not null fix #1152 --- tarteaucitron.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index d590e902..dc8c6f7e 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1908,7 +1908,9 @@ var tarteaucitron = { } } else { script = document.createElement('script'); - script.id = (id !== undefined) ? id : ''; + if (id !== undefined) { + script.id = id; + } script.async = true; script.src = url;