I'm having a shot at developing my first plugin for Joomla, its just a simple plugin which places some javascript just before the close of the body. The javascript works fine if I place it directly in the index.php for the template so Im confident in the js. My plugin however is throwing an error
Parse error: syntax error, unexpected 's' (T_STRING) in C:\xampp\blah\blah\plugins\system\reftagger\reftagger.php on line 50
I think it's to do with the use of the double quotes on the line 49 (where its adding the g.src) which is throwing things out of whack. The snippet below shows the script that Im trying to add which includes the double quotes
$ReftaggerOut = "
<script type='text/javascript'>
var refTagger = {
settings: {
bibleVersion: ".$BibleTranslation."
}
};
(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>
";
I've attempted
- to change the g.src to single brackets
- make it a /" for the g.src