Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Why isnt this javascript working?

Nov 8, 2007 8:58AM PST

This code runs perfectly when i test it on dreamweaver or just plain notepad. But when i paste these lines of code onto my <a href="http://www.ziked.com">tumblr</a> theme, they dont work anymore. Any idea why??

<head>
<script language=?JavaScript?>
var backColor = new Array();
backColor[0] = ?#FF9900?;
backColor[1] = ?#6498cc?;
function changeBG(whichColor){
document.bgColor = backColor[whichColor];
}
</script></head>

<body>

<a href=?javascript:changeBG(0)?>Orange</a>
<a href=?javascript:changeBG(1)?>Blue</a>
</body>

If it helps, I still have the non-working javascipt on my site - ziked.com

Discussion is locked