By the way, I also wanted to check the response status and when I print out response.status it comes back 0 so the status is 0... not sure why the AJAX call would fail when the GET request using the browser bar works fine.<br>
<br>thank you<br><br>alessandro ferrucci<br><br><br><div class="gmail_quote">On Tue, Oct 27, 2009 at 3:41 PM, Alessandro Ferrucci <span dir="ltr">&lt;<a href="mailto:alessandroferrucci@gmail.com">alessandroferrucci@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">hi, I actually in set the response to be HTML with &quot;&amp;INFO_FORMAT=text/html&quot;<br>
<br>in fact the response type in the header is text/html in the request.  I turned on firebug and I see the AJAX request and the response HTML is empty.  However when I copy the URL and put it straight in the browser, it comes back with the correct HTML.<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Tue, Oct 27, 2009 at 3:02 PM, Shawn Oatley <span dir="ltr">&lt;<a href="mailto:shawn@niagarafalls.ca" target="_blank">shawn@niagarafalls.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div style="margin: 4px 4px 1px; font-family: Segoe UI; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div>If you use Firefox and Firebug, you can watch the XML request go to / from the server.  Chances are, it is returning an XML object not a text object.  When this happens, responseText is empty and responseXML has your data.</div>


<div> </div>
<div>Shawn<div><div></div><div><br><br>&gt;&gt;&gt; On 10/27/2009 at 2:18 PM, Alessandro Ferrucci &lt;<a href="mailto:alessandroferrucci@gmail.com" target="_blank">alessandroferrucci@gmail.com</a>&gt; wrote:<br>
</div></div></div><div><div></div><div>
<div style="border-left: 1px solid rgb(5, 5, 5); margin: 0px 0px 0px 15px; background-color: rgb(243, 243, 243); padding-left: 7px;">Hello,<br>I&#39;m attempting to call getFeatureInfo from Openlayers to a geoserver instance.<br>

<br>Rigth now all I do is construct a GetFeatureInfo URL and supply that URL to a window.open method and it works fine, below is relevant code:<br><br>var wmsurl = &quot;<a href="http://dialga.npc.census.gov:8080/geoserver/wms" target="_blank">http://dialga.npc.census.gov:8080/geoserver/wms</a>&quot;;<br>

<br>map.events.register(&#39;click&#39;, map, function (e) {<br>var url = wmsurl + &quot;?REQUEST=GetFeatureInfo&quot; + &quot;&amp;EXCEPTIONS=application/vnd.ogc.se_xml&quot;<br>+ &quot;&amp;BBOX=&quot; + map.getExtent().toBBOX()<br>

+ &quot;&amp;X=&quot; + e.xy.x<br>+ &quot;&amp;Y=&quot; + e.xy.y<br>+ &quot;&amp;INFO_FORMAT=text/html&quot;<br>+ &quot;&amp;QUERY_LAYERS=cira:addresses&quot;<br>+ &quot;&amp;LAYERS=cira:addresses&quot;<br>+ &quot;&amp;FEATURE_COUNT=50&quot;<br>

+ &quot;&amp;SRS=EPSG:900913&quot;<br>+ &quot;&amp;STYLES=&quot;<br>+ &quot;&amp;WIDTH=&quot; + map.size.w<br>+ &quot;&amp;HEIGHT=&quot; + map.size.h;<br><br>window.open(url, &quot;getfeatureinfo&quot;, &quot;location=0,status=0,scrollbars=1,width=600,height=150&quot; );<br>

});<br><br>But now I want to be able to use OpenLayers.loadURL method to make an AJAX request to the geoserver instance and get back the XMLHttpRequest obejct and extract the HTMl from the responseText member.<br><br>this is the code:<br>

<br>var wmsurl = &quot;<a href="http://dialga.npc.census.gov:8080/geoserver/wms" target="_blank">http://dialga.npc.census.gov:8080/geoserver/wms</a>&quot;;<br><br>map.events.register(&#39;click&#39;, map, function (e) {<br>

var url = wmsurl<br>+ &quot;?REQUEST=GetFeatureInfo&quot;<br>+ &quot;&amp;EXCEPTIONS=application/vnd.ogc.se_xml&quot;<br>+ &quot;&amp;BBOX=&quot; + map.getExtent().toBBOX()<br>+ &quot;&amp;X=&quot; + e.xy.x<br>+ &quot;&amp;Y=&quot; + e.xy.y<br>

+ &quot;&amp;INFO_FORMAT=text/html&quot;<br>+ &quot;&amp;QUERY_LAYERS=cira:addresses&quot;<br>+ &quot;&amp;LAYERS=cira:addresses&quot;<br>+ &quot;&amp;FEATURE_COUNT=50&quot;<br>+ &quot;&amp;SRS=EPSG:900913&quot;<br>+ &quot;&amp;STYLES=&quot;<br>

+ &quot;&amp;WIDTH=&quot; + map.size.w<br>+ &quot;&amp;HEIGHT=&quot; + map.size.h;<br><br>OpenLayers.loadURL(url,&#39;&#39;,this,receiveGetFeatureInfo,receiveGetFeatureInfo);<br>});<br><br>function receiveGetFeatureInfo(response)<br>

{<br>alert(&quot;RESPONSE TEXT: &quot; + response.responseText);<br>}<br><br>responseText is ALWAYS empty... am I doing something wrong?<br><br>Thank you very much,<br><br clear="all"><br>-- <br>Signed,<br>Alessandro Ferrucci<br>

</div></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div>-- <br>Signed,<br><font color="#888888">Alessandro Ferrucci<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Signed,<br>Alessandro Ferrucci<br>