javascript - Change background image based on URL parts -


i trying add site capability, background change based on part of url using stylesheets.

example:

address/shop/index.php             = background image 1 address/shop/index.php?cpath=22    = background image 2 address/shop/index.php?cpath=23    = background image 3 address/shop/index.php?cpath=24    = background image 4 

any ideas? have looked @ javascript , jquery not sure on 1 choose or how go it.

it looks using php, should able without javascript. need use php's server variables.

something like

 $cpath = $_get['cpath']; //this allows access query part of url  if($cpath == 24){      //set background url  } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -