Last active
January 7, 2017 16:43
-
-
Save gracefullight/4d271576d5a3a163c036c36bb54f0b52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--#include virtual = "/JSON_2.0.4.asp"--> | |
| <% | |
| 'request TO JSON | |
| Dim req:Set req = jsObject() | |
| FOR EACH i IN Request.QueryString | |
| IF Request.QueryString(i).count > 1 THEN | |
| i = Replace(i,"&", "") | |
| Set req(i) = jsArray() | |
| FOR EACH j IN Request.QueryString(i) | |
| req(i)(null) = j | |
| NEXT | |
| ELSE | |
| req(i) = Request.QueryString(i) | |
| END IF | |
| NEXT | |
| FOR EACH x IN Request.Form | |
| IF Request.Form(x).count > 1 THEN | |
| Set req(x) = jsArray() | |
| FOR EACH y IN Request.Form(x) | |
| req(x)(null) = y | |
| NEXT | |
| ELSE | |
| req(x) = Request.Form(y) | |
| END IF | |
| NEXT | |
| 'session TO JSON | |
| Dim sess:Set sess = jsObject() | |
| FOR EACH k IN Session.Contents | |
| sess(k) = Session.Contents(k) | |
| NEXT | |
| %> | |
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <script type="text/javascript"> | |
| var request = JSON.parse('<%=req.flush%>'); | |
| var session = JSON.parse('<%=sess.flush%>'); | |
| Object.freeze(request); | |
| Object.freeze(session); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment