Forum Moderators: open
I thought a relatively simple way to do this would be to have two seperate JS files for the two quicktag sets and provide a link to toggle between the JS files. Unfortunately, it turns out it's not that easy.
I've tried adding an ID to the script tag, then changing the value of the src attribute...
function change(){
var script;
script = document.getElementById('script1');
script.src = "blah.js";
}
function check(){
var source;
var script;
script = document.getElementById('script1');
source = script.getAttribute('src');
alert(source);
}
In testing the resulting value of the SRC attribute (the check() function), the script IS changing the attribute. But, not surprisingly, it isn't changing the JS file being subsequently used by the page.
I suppose that makes sense, since the page isn't reloading, but unfortunately, this puts me at the limit of my js coding skills.
Any tips on a new approach to take to make a javascript SCRIPT file switcher?
Thanks in advance,
cEM