javascript - Proper Switch Statement? -
<script language="text/javascript"> var url = document.url; <--switch (url) { case "http://www.greatarchitect.us/defatank": document.write("displaying defatank"); break; case "seeingblue": document.write("displaying seeingblue"); break; case "shiroshii": document.write(""); break; case "theend66": document.write(""); break; case "wakawaka647": document.write(""); break; case "xtheguythatplays": document.write(""); break; }--> </script>
what wrong above code? i'm trying load specific data based on page url.
i updated code. how display url sure i'm checking case against right url?
document.url
returns entire web address. need filter/chop down in order manipulate part want.
also you're declaring script wrong. should <script type="text/javascript">
.
:)
Comments
Post a Comment