I know this question asked many times (e.g. OpenLayers 3: Cross-Origin Request Blocked: The Same Origin Policy disallows and Enabling CORS in geoserver 2.8.2 or how to use JSONP in geoserver?) but those all are not solving my issue.
I am working on WFS_T .Below is my code
var transactWFS_polygon = function (p, f) {
switch (p) {
case 'insert':
node = formatWFS.writeTransaction([f], null, null, formatGML_polygon);
break;
case 'update':
node = formatWFS.writeTransaction(null, [f], null, formatGML_polygon);
break;
case 'delete':
node = formatWFS.writeTransaction(null, null, [f], formatGML_polygon);
break;
}
s = new XMLSerializer();
str = s.serializeToString(node);
alert(str);
$.ajax('http://xxx:8076/geoserver/xxxx/ows', {
type: 'POST',
dataType: 'xml',
processData: false,
contentType: 'text/xml',
data: str
}).done();
}
I am getting 403 forbidden error in Options.How to enable option in geoserver which is running in localhost.