<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Harry,<br>
<br>
just guessing, but does IE show anything when you set the
options-value as well as its text? Try to add<br>
<br>
sbox.options[x].value=streetlist.features[x].properties.Adresse;<br>
<br>
after<br>
<br>
sbox.options[x].text=streetlist.features[x].properties.Adresse;<br>
<br>
As I said, this just a guess.<br>
<br>
Regards,<br>
Marc<br>
<br>
<br>
Am 31.05.2011 13:12, schrieb Budschedl Harald:
<blockquote
cite="mid:755D7A8C698CE141BF7791E841710C7DA8B3F93F5E@UGLCL01-MXS.ugl.linz.at"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
<font face="Arial, sans-serif" size="2">
<div>Hi folks</div>
<div> </div>
<div>I have a not strictly OL related problem concerning a
function call which works in FF, Safari, Opera, etc … but does
not work in IE (7 and 8)</div>
<div> </div>
<div>Let me tell you what I try to do.</div>
<div> </div>
<div>1st step:</div>
<div>An ajax control fills a selectbox with adresses. The
webservice delivers geoJSON btw. The serializing of the
JSON-Object (streetlist) and the filling of the selectbox
(sbox) looks like this:</div>
<div>--------></div>
<div>
streetlist = eval('(' + httpRequest.responseText + ')');</div>
<div>
//alert(streetlist);</div>
<div>
sbox = document.getElementById('straSel');</div>
<div>
sbox.length=streetlist.features.length-1;</div>
<div>
if (sbox.length<=0) {sbox.length=1}</div>
<div>
for(x=0; x< streetlist.features.length-1; x++){</div>
<div>
sbox.options[x].text=streetlist.features[x].properties.Adresse;</div>
<div>
}</div>
<div><----------</div>
<div>Everything works out fine. The Ajax works, the Selectbox is
filled, all of this works fine in all the browsers.</div>
<div>So now we have a Selectbox, filled with Adresses.</div>
<div> </div>
<div>2nd step:</div>
<div>From my selectbox, I select one entry and klick on the "get
me there"-button to call a function "goThere" which will find
the appropriate X and Y coords from the geoJSON Object and
zoom the map to there.</div>
<div>The Selectbox and "get me there" Butto look like this:</div>
<div>----------></div>
<div> <p></div>
<div> <select id="straSel"
name="straSel" size="5" ></div>
<div> <option
id="straOpt">Click result ...</option></div>
<div> </select></div>
<div> </p></div>
<div> <input type="button" value="get me
there" onclick="goThere();" /></div>
<div><----------</div>
<div>The function looks like this:</div>
<div>------------></div>
<div> function goThere() {</div>
<div> // gets XY coordinates for
selected entry and zooms there</div>
<div> var adressX;</div>
<div> var adressY;</div>
<div> </div>
<div> var selbox
=document.getElementById('straSel');</div>
<div> var
selIndx=selbox.selectedIndex;</div>
<div>
selectedAdr=selbox.options[selIndx].value;</div>
<div>
//alert(selbox.options[selbox.selectedIndex].value);</div>
<div> alert(" At index"+selIndx+"
in the box, there is "+selectedAdr);</div>
<div> if (streetlist) {</div>
<div> for(x=0; x<
streetlist.features.length-1; x++){</div>
<div> if
(streetlist.features[x].properties.Adresse == selectedAdr) {</div>
<div>
adressX=streetlist.features[x].geometry.coordinates[0];</div>
<div>
adressY=streetlist.features[x].geometry.coordinates[1];</div>
<div>
//alert(selectedAdr + '___X=' + adressX + '___Y=' + adressY);</div>
<div>
map.setCenter(new
OpenLayers.LonLat(adressX,adressY),allScales[1],false,true);</div>
<div>
break;</div>
<div> }</div>
<div> }</div>
<div> }</div>
<div> }</div>
<div><------------</div>
<div> </div>
<div>I also tried to deliver the Adress itself in the function
call, but this doesn't change anything.</div>
<div> </div>
<div>The function works fine in Firefox</div>
<div>It works fine in Safari</div>
<div>It works fine in Opera.</div>
<div>Heck, it even works fine on my Palm Pre Plus…</div>
<div> </div>
<div>Just IE (7 and 8) does not do ANYTHING. I found out (using
the alert statements) that the value is always empty in IE.</div>
<div> </div>
<div>Has anyone an idea what's the problem?</div>
<div> </div>
<div>TIA!!</div>
<div>Harry</div>
<div> </div>
<div><font face="Arial, sans-serif">IKT Linz GmbH </font></div>
<div><font face="Arial, sans-serif">Ein Unternehmen der Stadt
Linz</font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font face="Arial, sans-serif">4040 Linz, Hauptstraße 1-5</font></div>
<div><font face="Arial, sans-serif">AUSTRIA</font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font size="3"><br>
</font></div>
<div><font color="#c0c0c0" size="3"><u>
________________________________ </u></font></div>
<div><font color="#808080" face="Arial, sans-serif" size="1">Diese
Nachricht inklusive aller Anhänge kann vertrauliche
Informationen enthalten. Sie ist ausschließlich für die
adressierten Personen bestimmt. Das unerlaubte Kopieren
sowie die unbefugte Weitergabe
sind nicht gestattet. Sollten Sie nicht die richtige
Adressatin/der richtige Adressat sein, vernichten Sie den
gesamten Inhalt (§ 93 Abs. 4 Telekommunikationsgesetz 2003)
und informieren Sie bitte sofort den/die Absender/in. Nähere
Regelungen zur elektronischen
Kommunikation mit der Stadt Linz finden Sie in den
"Allgemeinen Hinweisen und Nutzungsbestimmungen betreffend
das E-Government der Stadt Linz (e-linz)" (
<a moz-do-not-send="true"
href="http://www.linz.at/images/AGB_egov_2008.pdf">http://www.linz.at/images/AGB_egov_2008.pdf</a>
)<br>
<br>
IKT Linz GmbH, Firmenbuch des Landesgerichtes Linz ++
Firmenbuch-Nummer: 321197z ++ UID-Nummer: ATU64636344<br>
IKT Linz Infrastruktur GmbH, Firmenbuch des Landesgerichtes
Linz ++ Firmenbuch-Nummer: 321990s ++ UID-Nummer:
ATU64664303<br>
A-4020 Linz, Gruberstraße 42, Tel. +43 732 7070 0, Fax: +43
732 7070 54 1555, <a class="moz-txt-link-abbreviated" href="mailto:office@ikt.linz.at">office@ikt.linz.at</a>,
<a moz-do-not-send="true" href="http://www.linz.at/ikt">www.linz.at/ikt</a><br>
</font></div>
</font>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
</blockquote>
<br>
</body>
</html>