Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Pedro Victor

Background CSS

Recommended Posts

Olha eu aqui mais uma vez.

 

Fiz um mecanismo de busca, o código está abaixo.

 

A primeira página, onde fica o campo de busca, já ta transparente e não quero mecher nela. A segunda página, onde será mostrado os resultados da pesquisa, eu preciso colocar uma imagem de fundo ATRAVÉS DE UMA URL.

 

Segue o código:

 

<script LANGUAGE="JavaScript">


   Keyword = new Object();
   Descrip = new Object();
   Address = new Object();

// Keyword[0] = n  (where n is the number of keywords which can be searched
Keyword[0] = 1000

// Each entry is split into
// Keyword[n] = text (where text is the keyword of which the entry is to
// be searched by  (type Keywords in lowercase)
// Descrip[n] = text (where text is the description associated to this entry
// Address[n] = text (where text is the URL associated to the entry
//  n is the entry number.

Keyword[1] = "teste" 
Descrip[1] = "Excelented to COOLNERDS, where I downloaded a Java commands guide. I needed to look-up a few commands in his refernce guide. Cheers!"
Address[1] = "http://www.wix.com"

   function checkDatabase() {

     var Found = false
     var Item = document.forms[0].searchfor.value.toLowerCase();

stats='toolbar=no,location=no,directories=no,status=no,menubar=no,' 
stats += 'scrollbars=yes,resizable=yes' 
MsgBox = window.open (target="blank")
MsgBox.document.write ("<BODY background-image: url(http://img215.imageshack.us/img215/226/greenvectorwallpaperbyb.png)>") 

----------------------------------AQUI EM CIMA O CÓDIGO DO BACKGROUND ÓÓÓ-------------------------------------- 
---------------------------------------------------------------------------------------------------------------

MsgBox.document.write("<head><title>Resultado da pesquisa - Cultura Literária</title></head>");
MsgBox.document.write ("<BODY <H2><CENTER>Resultados da busca</CENTER></H2>") 
MsgBox.document.write ("<H3>Resultados encontrados para:  "+Item+"<HR>");
       for (var i=1; i <= Keyword[0]; i++) {
 	if(Item == Keyword[i]) {
  Found = true;
 MsgBox.document.write ("<H4>"+Descrip[i]+"<BR><A HREF="+Address[i]+">Clique aqui para acessar</A></H4>") 

       }
     }
     if(!Found)
MsgBox.document.write ("<H4>A pesquisa não obteve nenhum resultado</H4>") 
MsgBox.document.write ("<FORM><CENTER>") 
MsgBox.document.write ("<INPUT type='button' value='Fechar' onClick = 'self.close()'>") 
MsgBox.document.write ("</CENTER></FORM>")     }

</SCRIPT>


   <FORM NAME="form1">
<div align="right"><FONT SIZE=3></FONT><INPUT TYPE="text" NAME="searchfor" <input type="text" name="nome" value="Digite aqui" onFocus="if (this.value=='Digite aqui') this.value='';"> <br /> <SIZE=20><INPUT TYPE="button" VALUE="Pesquisar" onClick="checkDatabase()"><BR></div>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Voce misturou CSS, com HTML

 

Voce não colocou style!

 

Com style fica:

 

MsgBox.document.write ("<BODY style='background-image: url(http://img215.imageshack.us/img215/226/greenvectorwallpaperbyb.png)'>");

 

 

 

Sem o style(CSS) fica assim:

MsgBox.document.write ("<BODY background='http://img215.imageshack.us/img215/226/greenvectorwallpaperbyb.png'>");

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.