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++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -