markus / ConvertService / ServiceBase / StationRestTest / HtmlPage.html @ c8183702
이력 | 보기 | 이력해설 | 다운로드 (1.06 KB)
1 | 2bbea412 | taeseongkim | <!DOCTYPE html>
|
---|---|---|---|
2 | <html>
|
||
3 | <head>
|
||
4 | <meta charset="utf-8" /> |
||
5 | <title></title> |
||
6 | </head>
|
||
7 | <body>
|
||
8 | <script type="text/javascript"> |
||
9 | function post_to_url(path, params, method) {
|
||
10 | method = method || "post";
|
||
11 | |||
12 | var form = document.createElement("form");
|
||
13 | |||
14 | //Move the submit function to another variable
|
||
15 | //so that it doesn't get overwritten.
|
||
16 | form._submit_function_ = form.submit;
|
||
17 | |||
18 | form.setAttribute("method", method);
|
||
19 | form.setAttribute("action", path);
|
||
20 | |||
21 | for(var key in params) {
|
||
22 | var hiddenField = document.createElement("input");
|
||
23 | hiddenField.setAttribute("type", "hidden");
|
||
24 | hiddenField.setAttribute("name", key);
|
||
25 | hiddenField.setAttribute("value", params[key]);
|
||
26 | |||
27 | form.appendChild(hiddenField);
|
||
28 | }
|
||
29 | |||
30 | document.body.appendChild(form);
|
||
31 | form._submit_function_(); //Call the renamed function.
|
||
32 | }
|
||
33 | |||
34 | post_to_url("http://localhost:9101/StationService/Rest/GetConvertItem", { ProjectNo: "111111", DocumentID:"2833409804" } );
|
||
35 | </script>
|
||
36 | |||
37 | </body>
|
||
38 | </html> |