Javascript Form POST request only working on chrome

时间:2016-04-12 00:45:49

标签: javascript google-chrome firefox post

So when I click the button on chrome it makes the request and a zip file is downloaded no problem. On Firefox on Windows and Mac it does not work on IE too.

 <link rel="stylesheet" type="text/css" href="style.css"/>
  <div id="send" class="button" onclick="submitOgreReq(geojsonFeature);     return false">TEST</div>

var geojsonFeature = {
"type": "Feature",
"properties": {
    "name": "Coors Field",
    "amenity": "Baseball Stadium",
    "popupContent": "This is where the Rockies play!"
},
"geometry": {
    "type": "Point",
    "coordinates": [-104.99404, 39.75621]
}
};

function submitOgreReq(geojson) {

 var f = document.createElement('form')
f.action = 'https://ogre.adc4gis.com/convertJson'
f.method = 'POST'
 var i = document.createElement('input')
i.value = JSON.stringify(geojson)
i.name = "json"
f.appendChild(i)
f.submit()


}

0 个答案:

没有答案