css - Change background whit local hour -


this code system hour , change background image

 victorhora = new date  if (victorhora.gethours() > 5) {     imagem = 'my image. im not allowed post link'; } else if (victorhora.gethours() > 18) {     imagem = 'my image. im not allowed post link'; } else {     imagem = 'my image. im not allowed post link'; } </script> <script> $('body').css('background-image', 'url( + imagem + )');  </script> </head> 

but background don't appears think suck's this:

$('body').css('background-image', 'url( + imagem + )'); 

can me?

note: if put document.write(imagem), link appears.

you're not concatenating string.

this

$('body').css('background-image', 'url( + imagem + )'); 

should this:

$('body').css('background-image', 'url( '+ imagem + ')'); 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -