I asked whether or not this is even necessary over in the General forum first. So if you wan to comment on that please do it there.
If it is a good idea to add a fallback via javascript, I think I’m most of the way there.
[CODE]if ( !window.jQuery || typeof jQuery == ‘undefined’ ) {
var scripts = document.getElementsByTagName(‘script’);
for(var i=0; i < scripts.length; i++)
{
if(scripts[i].src == translation_array.template_directory_uri + ‘/js/combined-theme-scripts.js’)
{
//scripts[i] is the one
break;
}
}
This checks for jquery and if not present loops through all the script tags until it finds the theme scripts. (I think) I’m new to js.
What I’d like it to do then is build a script tag that points to the local copy of jquery and append it to the dom just before the theme scripts. This all happens in the footer before /body, not in the head. It just needs to add jquery right before the theme scripts to work.
Except I can’t use append I don’t think, because that’s jquery. I need something that does it with javascript only.
Could I get a nudge in the right direction please?
Oh, and if this is a total waste of time and brain power, please go let me know in the General section thread on this. I’d add the link to it but they’re taking their time moderating it, sry.
Thanks!