Files
openlayers/master/examples/formAction.html
Éric Lemoine 5d14b9e2d4 Updated
2013-02-20 10:38:25 +01:00

27 lines
998 B
HTML

<html>
<!-- form submit page that grabs the parameters from the URL and calls javascript with an array -->
<head>
<script type='text/javascript'>
var values = {};
var win = frameElement.ownerDocument.defaultView||frameElement.document.parentWindow;
var str = window.location.search.substr(1).replace(/[%]0D/g, "").replace(/[+]/g, " ").split(/&/);
for(var i=0; i<str.length; i++){
var split = str[i].split(/=/),
key = unescape(split[0] || ''),
value = unescape(split[1] || '');
if(values[key] === undefined){
values[key] = value;
}else if(values[key] instanceof Array || typeof values[key] == "array"){
values[key].push(value);
}else{
var old = values[key];
values[key] = [old, value];
}
}
frameElement.values = values;
</script>
</head>
<body onload="setTimeout(function(){ frameElement.values = null; window.location.href='about:blank' }, 0)">
</body>
</html>