Wapp

Check-in [9580d1fedb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the formajax02.tcl example, use the encodeURIComponent() javascript function instead of escape() so that the "+" character is correctly escaped. Fix for ticket [a38160c72116b1ba04c]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:9580d1fedbe0ac72a87f6eda7f572ed40af23a610087fa4bbe69bb84f41c4479
User & Date: drh 2018-02-14 01:52:08
Context
2018-02-14
01:56
In the formajax02.tcl example, change the name of the AJAX accept procedure to "acceptajax" which makes more sense than the former name of "acceptjson". check-in: d5adad95cd user: drh tags: trunk
01:52
In the formajax02.tcl example, use the encodeURIComponent() javascript function instead of escape() so that the "+" character is correctly escaped. Fix for ticket [a38160c72116b1ba04c] check-in: 9580d1fedb user: drh tags: trunk
2018-02-10
20:21
Add an edit function to the shopping list application. check-in: 43323e55a9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to examples/formajax02.tcl.

31
32
33
34
35
36
37

38

39
40
41
42
43
44
45
# submissions to be send using XMLHttpRequest with urlencoded content.
#
proc wapp-page-script.js {} {
  wapp-mimetype text/javascript
  wapp-cache-control max-age=3600
  wapp-trim {
    document.getElementById("nameForm").onsubmit = function(){

      function val(id){ return escape(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.setRequestHeader("Content-Type",
                             "application/x-www-form-urlencoded");







>
|
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# submissions to be send using XMLHttpRequest with urlencoded content.
#
proc wapp-page-script.js {} {
  wapp-mimetype text/javascript
  wapp-cache-control max-age=3600
  wapp-trim {
    document.getElementById("nameForm").onsubmit = function(){
      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.setRequestHeader("Content-Type",
                             "application/x-www-form-urlencoded");