Using Jquery, I am aiming to get png map from postGIS which has been created dynamically from node server in different port. I used jsonp to overcome cross domain issue in jquery.

$.ajax( 'http://localhost:3000/terrain', { type:'GET', crossOrigin: true, data:koordObj, contentType: "content-Type: application/image", dataType: "jsonp", success:function (data) { console.log(data); } }) .error( function() { console.log("error"); });

server creates the image as : "
localhost:3000/terrain/?callback=photos&minx=4000660.554526325&miny=4862598.159515699&maxx=4014342.782589372&maxy=4869286.399490653&terrain=slp&zoom=14&_=1459928691680 "

But firefox arises this error: SyntaxError: illegal character �PNG ​What might the problem be?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.