source: Dev/branches/rest-dojo-ui/client/dijit/tests/formAction.html @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 972 bytes
Line 
1<html>
2<!-- form submit page that grabs the parameters from the URL and calls javascript with an array -->
3<head>
4<script type='text/javascript'>
5        var values = {};
6        var win = frameElement.ownerDocument.defaultView||frameElement.document.parentWindow;
7        var str = window.location.search.substr(1).replace(/[%]0D/g, "").replace(/[+]/g, " ").split(/&/);
8        for(var i=0; i<str.length; i++){
9                var split = str[i].split(/=/),
10                        key = unescape(split[0] || ''),
11                        value = unescape(split[1] || '');
12                if(values[key] === undefined){
13                        values[key] = value;
14                }else if(values[key] instanceof Array || typeof values[key] == "array"){
15                        values[key].push(value);
16                }else{
17                        var old = values[key];
18                        values[key] = [old, value];
19                }
20        }
21        frameElement.values = values;
22</script>
23</head>
24<body onload="setTimeout(function(){ frameElement.values = null; window.location.href='about:blank' }, 0)">
25</body>
26</html>
Note: See TracBrowser for help on using the repository browser.