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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -