On Tue, Jul 30, 2013 at 8:29 PM, Hongda Li <[email protected]> wrote:

> Greetings,
>
> I am using GeoServer version 2.2.5, and what I try to do is making a AJAX
> call to get the json string from the output GeoJSON url, for example:
>
>
> http://localhost:8080/geoserver/sf/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sf:archsites&maxFeatures=50&outputFormat=json
>
> the javascript I used is like this:
>
>
>         var processJSON = function (data) {
>             console.log(data);
>         };
>         function init() {
>             //geojson url
>             var url = "
> http://localhost:8080/geoserver/sf/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sf:archsites&maxFeatures=50&outputFormat=json&&format_options=callback:processJSON
> ";
>
>             //execuate ajax request to get data
>             $.ajax({
>                 url: url,
>                 dataType: 'jsonp',
>                 jsonp: 'processJSON'
>             });
>
>         }
>
> I am pretty sure that this method works, because I can get the json object
> from the url which is from GeoServer version 2.2.4. But it just doesn't
> work for GeoServer 2.2.5 and later. I read somewhere that says "JSONP
> support has been disabled by default since it is perceived as a security
> issue." But I have no idea how to make it work.
>

By reading the docs:
http://docs.geoserver.org/latest/en/user/services/wfs/outputformats.html
http://docs.geoserver.org/latest/en/user/services/wms/global.html#wms-global-variables

Cheers
Andrea

-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to