947740 Posted April 13, 2010 Share Posted April 13, 2010 I can't figure out what's wrong with this script. IE says there is a missing expectected identifier: <script language='javascript' type='text/javascript'> function changeMain(class) { var main_table = document.getElementById('main'); switch(class) { case "soldier": main_table.innerHTML = "<p>HTML here</p>"; break; case "stealth": main_table.innerHTML = "HTML here"; break; case "armored": main_table.innerHTML = "HTML here"; break; case "engineer": main_table.innerHTML = "HTML here"; break; case "scout": main_table.innerHTML = "HTML here"; break; case "medic": main_table.innerHTML = "HTML here"; break; default: main_table.innerHTML = ""; } } function changeSecondary(class) { var primary_table = document.getElementById('primary'); switch(class) { case "spiritualist": primary_table.innerHTML = "HTML here"; break; case "stealth": primary_table.innerHTML = "HTML here"; break; case "firstaid": primary_table.innerHTML = "HTML here"; break; case "gunmaster": primary_table.innerHTML = "HTML here"; break; case "bombexpert": primary_table.innerHTML = "HTML here"; break; case "captain": primary_table.innerHTML = "HTML here"; break; case "supplier": primary_table.innerHTML = "HTML here"; break; case "pyromaniac": primary_table.innerHTML = "HTML here"; break; case "spy": primary_table.innerHTML = "HTML here"; break; default: primary_table.innerHTML = ""; } } </script> Quote Link to comment Share on other sites More sharing options...
yozyk Posted April 14, 2010 Share Posted April 14, 2010 Class is keyword. Rename parameters of your functions. Quote Link to comment Share on other sites More sharing options...
947740 Posted April 23, 2010 Author Share Posted April 23, 2010 Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.