Updated
This commit is contained in:
26
master/examples/formAction.html
Normal file
26
master/examples/formAction.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user