Changeset 413 in tmcsimulator for trunk/webapps/cptms/js
- Timestamp:
- 05/21/2019 07:53:16 AM (7 years ago)
- Location:
- trunk/webapps/cptms/js
- Files:
-
- 2 edited
-
cmsLayer.js (modified) (1 diff)
-
harLayer.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/cptms/js/cmsLayer.js
r400 r413 159 159 jsonstring = JSON.stringify(Object.values(messageDict)); //Can't use these in GET parameter ,null,4); 160 160 outString = "{\"data\":" + jsonstring + "}"; 161 console.log("outString = " + outString);162 var xhttp = new XMLHttpRequest();163 xhttp.open("GET", "../cgi-bin/saveCMSmessage.py?msg=" + outString, true);164 xhttp.send();165 console.log("status code: " + xhttp.status);166 // Using POST might be a better idea ... haven't tried this yet167 //var xhr = new XMLHttpRequest();168 // xhr.open("POST", "/cgi-bin/saveCMSmessage.py?", true);169 // xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');161 //console.log("outString = " + outString); 162 //var xhttp = new XMLHttpRequest(); 163 //xhttp.open("GET", "../cgi-bin/saveCMSmessage.py?msg=" + outString, true); 164 //xhttp.send(); 165 //console.log("status code: " + xhttp.status); 166 // Using POST to send the data 167 var xhr = new XMLHttpRequest(); 168 xhr.open("POST", "../cgi-bin/saveCMSmessage.py", true); 169 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 170 170 // send the collected data as JSON 171 // xhr.send(JSON.stringify(messageList));171 xhr.send("msg="+outString); 172 172 } 173 173 -
trunk/webapps/cptms/js/harLayer.js
r400 r413 117 117 outString = "{\"data\":" + jsonstring + "}"; 118 118 119 var xhttp = new XMLHttpRequest();120 xhttp.open("GET", "../cgi-bin/saveHARmessage.py?msg=" + outString, true);121 xhttp.send();122 // Using POST might be a better idea ... haven't tried this yet123 //var xhr = new XMLHttpRequest();124 // xhr.open("POST", "/cgi-bin/saveMessage.py?", true);125 // xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');119 //var xhttp = new XMLHttpRequest(); 120 //xhttp.open("GET", "../cgi-bin/saveHARmessage.py?msg=" + outString, true); 121 //xhttp.send(); 122 // Using POST to send the data 123 var xhr = new XMLHttpRequest(); 124 xhr.open("POST", "../cgi-bin/saveHARmessage.py", true); 125 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 126 126 // send the collected data as JSON 127 // xhr.send(JSON.stringify(messageList));127 xhr.send("msg="+outString); 128 128 } 129 129
Note: See TracChangeset
for help on using the changeset viewer.
