Hello all,
I have a menu system that I want to be able to onclick pass a url to a <script></script> (located in the main content of the page) where the url passed replaces the ‘src’ of that script.
The reason is because a lot of the links are syndicated content, and instead of having 10 or 20 extra pages just to load that content, I want to dynamically change the script src.
I don’t think it’s passing my variable because it’s a url or something.
Help please?
code:
<!–script that does all the work–>
<script type=”text/javascript”>
function synchange(pass)
{
var new_var = pass;
document.getElementById(“cursyncon”).setAttribute(“src”, new_var);
}
</script>
<!–menu part that activates the onclick and function, thus changing the content–>
<li><a href=”#” onclick=”synchange(‘
<!–goes in the main content junk where syndicated content shows up–>
<script id=”cursyncon” src=”#”></script>
thanks again for any help…!