Hi there, I’ve got a javascript snippet that I’m supposed to put before the closing body tag. It works, but just as described on this very old topic, it only seems to run on first page load. Because it is supposed to scan the contents of posts and create tooltips and links for certain phrases, it needs to run each time new content is loaded.
Because of the huge combination of potential strings (any Bible passage reference) to be linked, it is impossible to use a solution such as the Linkify words in post plugin.
Apparently this sort of thing is possible to pull off in a theme component, as linkify does, but in my case the snippet just loads the actual javascript file from an external server and tells it to run. Anybody have any idea how I can get this working on content loaded via ajax?
Here’s the javascript snippet:
<script>
var refTagger = {
settings: {
bibleVersion: "NASB",
socialSharing: []
}
};
(function(d, t) {
var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
g.src = "//api.reftagger.com/v2/RefTagger.js";
s.parentNode.insertBefore(g, s);
}(document, "script"));
</script>