Wapp

Diff
Login

Differences From Artifact [f5a8920017]:

To Artifact [2dac288c66]:


38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
53
54
55
56
57

58
59
60
61
62
63
64
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64







-
+











-
+







      function val(id){
        return encodeURIComponent(document.getElementById(id).value)
      }
      var jx = "firstname="+val("firstName")+
               "&lastname="+val("lastName")+
               "&age="+val("age");
      var xhttp = new XMLHttpRequest();
      xhttp.open("POST", "%string([wapp-param SCRIPT_NAME])/acceptjson", true);
      xhttp.open("POST", "%string([wapp-param SCRIPT_NAME])/acceptajax", true);
      xhttp.setRequestHeader("Content-Type",
                             "application/x-www-form-urlencoded");
      xhttp.send(jx);
      return false
    }
  }
}

# This page accepts a form submission and prints it on standard output.
# A real server would do something useful with the data.
#
proc wapp-page-acceptjson {} {
proc wapp-page-acceptajax {} {
  puts "Accept Callback"
  puts "mimetype: [list [wapp-param CONTENT_TYPE]]"
  puts "content: [list [wapp-param CONTENT]]"
  foreach var [lsort [wapp-param-list]] {
    if {![regexp {^[a-z]} $var]} continue
    puts "$var = [list [wapp-param $var]]"
  }