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++: Boost interprocess memory mapped file error -

python - IO.UnsupportedOperation: Not Writable -

python - Selecting distinct values from a column in Peewee -