Hello everyone,
Got into really strange problem. Basically I want to render some script right into overlay box.
Everything working perfectly fine except the "script" tags got removed automatically. After spending few minutes with Xenforo code I realized the file responsible for rendering Overlay stuff is doing this by purpose.
File: js/xenforo/xenforo.js
Line # 3377 (after deminifying it)
That's been said, now I want to request if anyone else in developer community can suggest how to disable this behaviour using plugin or what's the best way to accomplish this.
At this time I want my script to be in contact form with one extra field. The extra field is already there but useless when opened in overlay.
Just to clarify this further, my use case not allow me to put script stuff inside footer.
Got into really strange problem. Basically I want to render some script right into overlay box.
Everything working perfectly fine except the "script" tags got removed automatically. After spending few minutes with Xenforo code I realized the file responsible for rendering Overlay stuff is doing this by purpose.
File: js/xenforo/xenforo.js
Line # 3377 (after deminifying it)
Code:
createOverlay: function(a, b, d) {
var e = null,
f = null,
h = null,
f = /<script[^>]*>([\s\S]*?)<\/script>/ig,
j, h = [];
if (b instanceof jQuery && b.is(".xenOverlay")) e = b.appendTo("body"), f = b;
else {
if (typeof b == "string") {
for (; j = f.exec(b);) h.push(j[1]);
b = b.replace(f, "")
}
f = c(b);
f.is(".NoAutoHeader") || d && d.title && c('<h2 class="heading h1" />').html(d.title).prependTo(f);
f.is(".formOverlay") && f.find(".submitUnit").length && (f.find(".submitUnit :reset").length || f.find(".submitUnit .button:last").after(c('<input type="reset" class="button OverlayCloser" />').val(XenForo.phrases.cancel)).after(" "));
e = c('<div class="xenOverlay __XenForoActivator" />').appendTo("body").addClass(c(b).data("overlayclass")).append(f);
That's been said, now I want to request if anyone else in developer community can suggest how to disable this behaviour using plugin or what's the best way to accomplish this.
At this time I want my script to be in contact form with one extra field. The extra field is already there but useless when opened in overlay.
Just to clarify this further, my use case not allow me to put script stuff inside footer.