I'm using my localhost geoserver to display the data in webworldwind application (using javascript and html).
I got the error
XMLHttpRequest cannot load http://localhost:8080/geoserver/topp/wms?service=WMS&request=GetCapabilities&version=1.3.0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
- I solved this issue by add an extension **Allow-Control-Allow-Origin: ** in the chrome
- But, I need javascript code for CORS ORIGIN to add in my application instead of the extension i used in browser
I didn't found any solution. I'm drained by searching.