Ir para conteúdo

POWERED BY:

Arquivado

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

webfuture

Falha em envio de dados

Recommended Posts

Olá galera, tenho um div em minha pagina onde listo alguns artistas relativos a inicial escolhida do usuário, porém, ao clicar em qualquer inicial não consigo retornar os resultados e o erro que é apresentado é Objeto Necessário, porém, como não manjo muito de JS e AJax não estou conseguindo achar onde estou errando..

 

Olhem o código:

 

Função

<script type="text/javascript">var xmlHttp;var inicial;function createXMLHttpRequest() {	if (window.ActiveXObject) {		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");	}	else if (window.XMLHttpRequest) {		xmlHttp = new XMLHttpRequest();	}}function startRequest(field) {	inicial = document.getElementById(field);	createXMLHttpRequest();	xmlHttp.onreadystatechange = handleStateChange;	xmlHttp.open("get", "artistas_iniciais.asp?inicial=" + inicial.value, true);	xmlHttp.send(null);}function handleStateChange() {	if(xmlHttp.readyState == 4) {		if(xmlHttp.status == 200) {			document.getElementById("resultado").innerHTML = xmlHttp.responseText;		}	}}</script>

Tabela onde é escolhido a inicial do artista

 

<table cellspacing="0" cellpadding="0" width="168" border="0" align="LEFT">																								<tr>																									<td width="100%">																									<fieldset><legend style="FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #000080; FONT-FAMILY: Verdana"><A HREF="cadastro.asp" CLASS="AZUL">Busca de Artistas</A>  </legend>																										<table cellspacing="3" cellpadding="3" width="100%" border="0">																											<tr>																												<td class="comentarios" width="100%">																												<span id="cm1_txt_comentario">																												<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1">																													<TR>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('a');" CLASS="AZUL" TITLE="A"><B>A</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('b');" CLASS="AZUL" TITLE="B"><B>B</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('c');" CLASS="AZUL" TITLE="C"><B>C</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('d');return false;" CLASS="AZUL" TITLE="D"><B>D</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('e');return false;" CLASS="AZUL" TITLE="E"><B>E</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('f');return false;" CLASS="AZUL" TITLE="F"><B>F</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('g');return false;" CLASS="AZUL" TITLE="G"><B>G</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('h');return false;" CLASS="AZUL" TITLE="H"><B>H</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('i');return false;" CLASS="AZUL" TITLE="I"><B>I</B></A></TD>																													</TR>																													<TR>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('j');return false;" CLASS="AZUL" TITLE="J"><B>J</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('k');return false;" CLASS="AZUL" TITLE="K"><B>K</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('l');return false;" CLASS="AZUL" TITLE="L"><B>L</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('m');return false;" CLASS="AZUL" TITLE="M"><B>M</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('n');return false;" CLASS="AZUL" TITLE="N"><B>N</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('o');return false;" CLASS="AZUL" TITLE="O"><B>O</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('p');return false;" CLASS="AZUL" TITLE="P"><B>P</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('q');return false;" CLASS="AZUL" TITLE="Q"><B>Q</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('r');return false;" CLASS="AZUL" TITLE="R"><B>R</B></A></TD>																													</TR>																													<TR>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('s');return false;" CLASS="AZUL" TITLE="S"><B>S</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('t');return false;" CLASS="AZUL" TITLE="T"><B>T</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('u');return false;" CLASS="AZUL" TITLE="U"><B>U</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('v');return false;" CLASS="AZUL" TITLE="V"><B>V</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('w');return false;" CLASS="AZUL" TITLE="W"><B>W</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('x');return false;" CLASS="AZUL" TITLE="X"><B>X</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('y');return false;" CLASS="AZUL" TITLE="Y"><B>Y</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('z');return false;" CLASS="AZUL" TITLE="Z"><B>Z</B></A></TD>																														<TD ALIGN="center"><A HREF="#" OnClick="startRequest('0-9');return false;" CLASS="AZUL" TITLE="0-9"><B>0-9</B></A></TD>																													</TR>																												</TABLE>																												</span>																												</td>																											</tr>																											<tr>																												<td class="comentarios" align=center width="100%"><span id="cm1_txt_coment_clie"></span><span id="cm1_txt_coment_data"></span></td>																											</tr>																										</table>																									</fieldset>																									</td>																								</tr>																							</table>

Script de Busca relativo a inicial

 

<!--#include file="../includes/funcoes.asp"--><TABLE ALIGN="CENTER" WIDTH="100%" BORDER="0">	<TR>		<%		inicial = Remove_Quotes(Request("inicial"))		if inicial <> "" then		Set RsListaArtistas = Server.CreateObject("AdoDB.Recordset")		if inicial = "0-9" then		inicial0 = "0"		inicial1 = "1"		inicial2 = "2"		inicial3 = "3"		inicial4 = "4"		inicial5 = "5"		inicial6 = "6"		inicial7 = "7"		inicial8 = "8"		inicial9 = "9"		RsListaArtistas.open "Select top 18 id, nome from TB_Artistas WHERE nome like '" & inicial0 & "%' or nome like '" & inicial1 & "%' or nome like '" & inicial2 & "%' or nome like '" & inicial3 & "%' or nome like '" & inicial4 & "%' or nome like '" & inicial5 & "%' or nome like '" & inicial6 & "%' or nome like '" & inicial7 & "%' or nome like '" & inicial8 & "%' or nome like '" & inicial9 & "%' order by nome desc", conexaoSQL		else		RsListaArtistas.open "Select top 18 id, nome from TB_Artistas WHERE nome like '" & inicial & "%' order by nome desc", conexaoSQL'		'RsListaArtistas.open "Select TOP 18 id, nome from TB_Artistas order by nome desc", conexaoSQL		end if		while not RsListaArtistas.EOF		id = RsListaArtistas.fields("id")		nome = RsListaArtistas.fields("nome")		total = total + 1		if total = 3 or total = 5 or total = 7 or total = 9 or total = 11 or total = 13 or total = 15 or total = 17 or total = 19 or total = 21 or total = 23 or total = 25 or total = 27 or total = 29 or total = 31 or total = 33 then			Response.Write "<TR><TD HEIGHT=4></TD></TR>"		end if		%>		<TD ALIGN="LEFT"><a class="preto" href="artistas_mostra.asp?id_artista=<%Response.Write id%>"><%response.Write nome%></a></TD>		<TD WIDTH="5"></TD>		<%		RsListaArtistas.movenext		wend		RsListaArtistas.close		set RsListaArtistas = nothing		end if		%>	</TR>	<TR>		<TD HEIGHT="10"></TD>	</TR>	<TR>		<TD COLSPAN="4" ALIGN="RIGHT" CLASS="FORMATO1">Próxima »</TD>	</TR>	</TABLE>

Deve ser algo simples, mas não estou achando...

 

Se alguém puder me ajudar,

 

WebFuture

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.