digitalpoint
Well-known member
- Affected version
- 2.1.0
Ran into an issue where a page with a little bit of inline JavaScript (via <xf:js>) wouldn't run if the page was loaded with AJAX, but it would if it wasn't loaded with AJAX. Specifically the inline JavaScript used XF.Element.register() and it didn't seem to get fired.
Not sure if it's intended, but it looks like core.js is firing XF.activate() before it evaluates the inline JavaScript that came from the AJAX response.
Shouldn't new JavaScript be executed before the new content is "activated"?
Work around is to move that line of JavaScript to an external .js file (then it works as HTML or AJAX page rendering).
Not sure if it's intended, but it looks like core.js is firing XF.activate() before it evaluates the inline JavaScript that came from the AJAX response.
JavaScript:
if (!skipActivate)
{
XF.activate($html);
}
for (var j = 0; j < embeddedScripts.length; j++)
{
$.globalEval(embeddedScripts[j]);
}
Shouldn't new JavaScript be executed before the new content is "activated"?
Work around is to move that line of JavaScript to an external .js file (then it works as HTML or AJAX page rendering).