我写了这段代码:
function json()
{
var url="http://192.172.2.23:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=json&typeName=topp:networkcoverage&CQL_FILTER= topp:CELL_ID='410-07-301-31781' Or topp:CELL_ID='nnn'&callback=?";
jQuery.getJSON(url,function(data){alert("Symbol: " + data.type + ", Price: " + data.bbox);
});
}
在 FF 中出现错误:
Error: invalid label
Source File: http://192.172.2.23:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=json&typeName=topp:networkcoverage&CQL_FILTER=%20topp:CELL_ID=%27410-07-301-31781%27%20Or%20topp:CELL_ID=%27nnn%27&callback=processJSON
Line: 1, Column: 1
Source Code:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"networkcoverage.13333","geometry":{"type":"MultiPolygon","coordinates":[[[[33.67787000000004,73.02342000000004],[33.68024256600006,73.02193745600005],[33.68066767800008,73.02342000000004],[33.......
在遇到跨域问题之前,我对 XmlHttpRequest 很满意……我尝试了各种库,并且所有 JSON 函数都出现相同的错误。
我认为响应可能有问题,但我将响应放在此 web 实用程序上以检查格式是否正确,并且在此 URL http://openlayers.org/dev/examples/vector-formats.html上运行良好
我在这里想念什么?