title: GML and GeoJSON vector layer can not display in Firefox and Chrome
body: <p>I have following codes. It works perfectly in IE (GML and GeoJSON vector layer was loaded), but not in Firefox and Chrome without any errors noticed. Please help me to fix this problem.</p>
  
  <p>Here is the code with GML vector layer (I just used built-in layer in Geoserver, so you can download and test it without any modification):</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Creating a simple map&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;!-- Include OpenLayers library --&gt;
  &lt;script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"&gt;&lt;/script&gt;
  &lt;style&gt;
      html, body {
          width: 100%;
          height: 100%;
          margin: 0;
          padding: 0;
      }
  &lt;/style&gt;
  &lt;!-- The magic comes here --&gt;
  &lt;script type="text/javascript"&gt;
      var map;
      function init() {
          var bounds = new OpenLayers.Bounds(
              -124.73142200000001, 24.955967,
              -66.969849, 49.371735
          );
          var options = {
              controls: [],
              maxExtent: bounds,
              maxResolution: 0.22563114453125,
              projection: "EPSG:4326",
              units: 'degrees'
          };
  
          map = new OpenLayers.Map("ch3_wfs",options);
  
          var baseLayer = new OpenLayers.Layer.WMS("Basic","http://localhost:8080/geoserver/wms",
          {
              layers: "topp:states",
          });    
          map.addLayer(baseLayer);
  
          var statesLayer = new OpenLayers.Layer.Vector("States", {
              protocol: new OpenLayers.Protocol.HTTP({
                  url: "http://localhost:8080/geoserver/topp/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=topp:states&amp;maxFeatures=50",
                  format: new OpenLayers.Format.GML()
              }),
              strategies: [new OpenLayers.Strategy.Fixed()],
          });
  
          map.addLayer(statesLayer);
  
          map.addControl(new OpenLayers.Control.LayerSwitcher());
          map.setCenter(new OpenLayers.LonLat(0,0), 2);
          map.zoomToMaxExtent();
  
      }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="init()"&gt;
      &lt;div id="ch3_wfs" style="width: 100%; height: 100%;"&gt;&lt;/div&gt;&lt;br&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the code with GeoJSON vector layer (I just used built-in layer in Geoserver, so you can download and test it without any modification):</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Creating a simple map&lt;/title&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;!-- Include OpenLayers library --&gt;
  &lt;script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"&gt;&lt;/script&gt;
  &lt;style&gt;
      html, body {
          width: 100%;
          height: 100%;
          margin: 0;
          padding: 0;
      }
  &lt;/style&gt;
  &lt;!-- The magic comes here --&gt;
  &lt;script type="text/javascript"&gt;
      var map;
      function init() {
          var bounds = new OpenLayers.Bounds(
              -124.73142200000001, 24.955967,
              -66.969849, 49.371735
          );
          var options = {
              controls: [],
              maxExtent: bounds,
              maxResolution: 0.22563114453125,
              projection: "EPSG:4326",
              units: 'degrees'
          };
  
          map = new OpenLayers.Map("ch3_wfs",options);
  
          var baseLayer = new OpenLayers.Layer.WMS("Basic","http://localhost:8080/geoserver/wms",
          {
              layers: "topp:states",
  
          });    
          map.addLayer(baseLayer);
  
          var statesLayer = new OpenLayers.Layer.Vector("States", {
              protocol: new OpenLayers.Protocol.HTTP({
                  url: "http://localhost:8080/geoserver/topp/ows?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typeName=topp:states&amp;maxFeatures=50&amp;outputFormat=json",
                  format: new OpenLayers.Format.GeoJSON()
              }),
              strategies: [new OpenLayers.Strategy.Fixed()],
          });
          map.addLayer(statesLayer);
  
          map.addControl(new OpenLayers.Control.LayerSwitcher());
          map.setCenter(new OpenLayers.LonLat(0,0), 2);
          map.zoomToMaxExtent();
      }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="init()"&gt;
      &lt;div id="ch3_wfs" style="width: 100%; height: 100%;"&gt;&lt;/div&gt;&lt;br&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>