ela não dá erro, mas tb não funciona…rs
ela entra na função ShowAddres mas pára no 1º alert que coloquei para debug - alert(“passou1”)
desculpe, sou nova aqui e não sabia que tinha que utilizar as tags [code] para melhor visualização…
eu vou colocar o código todo aqui, acho que fica melhor de entender…
[code]<% option explicit %>
<!–#include file=“conn_mysql.asp”–>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” xmlns:v=“urn:schemas-microsoft-com:vml”>
<head>
<meta http-equiv=“content-type” content=“text/html; charset=UTF-8”/>
<title>MASHUPS</title>
<script src=“http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA” type=“text/javascript”></script>
<script type=“text/javascript”>
var map = null;
var geocoder = null;
var xEnd;
var xResult = null;
Request.form("Espec") = "";
<%
Dim xEndereco, xEsp, xPassou
Dim Vetor(1000)
%>
function initialize()
{
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(-21.237660887121, -45.809251627144), 4);
geocoder = new GClientGeocoder();
}
function showAddress(address)
{
alert("passou1");
alert(geocoder);
if (geocoder)
{
alert("passou2");
geocoder.getLatLng(address, function(point)
{
if (!point)
{
alert("passou3");
alert(address + " not found");
}
else
{
alert("passou4");
map.setCenter(point, 4);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
}
</script>
</head>
<body onload=“initialize()” onunload=“GUnload()”>
<form action=“mapa.asp” method=“post” onsubmit=“showAddress(this.address.value); return false” >
<table>
<tr>
<td>
<%
Dim Conn, RS, SQL, objRecordset
Set Conn = Server.CreateObject("ADODB.Connection")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
Conn.Open strMySQL
SQL = "Select DESCRICAO from ESP_REST order by DESCRICAO"
Set RS = Conn.Execute(SQL)
Response.Write "<select name='Espec' size=1 onchange='form.submit()'>"
Response.Write"<OPTION>-Selecione a Especialidade-</OPTION>"
do while not RS.EOF
Response.Write"<OPTION "
if CInt(Request.Form("Especialidade"))= RS(0) then
Response.Write"selected "
end if
Response.Write"value='"&RS(0)&"'>"&RS(0)&"</OPTION>"
RS.MoveNext
loop
Response.Write"</SELECT>"
RS.close
%>
</td>
</tr>
</table>
<%
Dim xQtdeEnd
xQtdeEnd = 0
xPassou="false"
if (Request.form("Espec") <> "-Selecione a Especialidade-") then
SQL = "Select ENDERECO, CIDADE, UF from RESTAURANTE where COD_ESP='"&Request.form("Espec")&"'"
Set RS = Conn.Execute(SQL)
while not RS.EOF
xQtdeEnd = xQtdeEnd + 1
xPassou="true"
xEndereco = RS("ENDERECO") & ", " & RS("CIDADE") & ", " & RS("UF")
Vetor(xQtdeEnd) = xEndereco
RS.movenext
wend
'response.write Vetor(1)
'response.write Vetor(2)
end if
'style="visibility: hidden"
%>
<script LANGUAGE="JavaScript">
var k, Qtde, Passou;
Qtde=0;
Passou="";
Passou='<%=xPassou%>';
if (Passou=="true")
{
Qtde='<%=xQtdeEnd%>';
xEnd='<%=Vetor(1)%>';
address=xEnd;
showAddress(address);
}
</script>
<p>
<input type="text" size="60" name="address" id="address"/>
<input type="submit" name="buscar" value="Go!" />
</p>
<div id="map_canvas" style="width: 100%; height: 486px"></div>
</form>
</body>
</html>
[/code]
Obrigada pela atenção!!