Currently I'm trying to use Ajax for my site ....... Because of data Size is not limited to I need to use the post method to send data, but the problem is that I am unable to fetch post variables in test.asp
here is the script I use I am
function service (content) {var xmlhttp; If (window.XMLHttpRequest) {// code for IE7 +, Firefox, Chrome, Opera, Safari xmlhttp = New XMLHttpRequest (); } Else {// code for IE6, IE5 xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); } Xmlhttp.onreadystatechange = function () {if (xmlhttp.readyState == 4 & xmlhttp.status == 200} {msg = xmlhttp.responseText; Warning (MSG);}} Var para = encodeurIComponent ("content =" Xmlhttp.send (para)} and here is the test.asp code
t = Request.form ("content") Response.write (t) Please help solve this problem by bringing the post method variable in test.asp
if possible, in an APP classic, with the post method jquery agc You can share the code of those who will be helpful
You need to change this:
var para = encodeurIComponent ("content =" + content) in:
var para = "content =" + Encodeuric component (content); The way it was, you were submitting anything to the server like this:
content% 3Dtest% 20data% 20123 With the adjusted line of code, you are submitting something like this, which should be as follows:
content = test % 20data% 20123 Did you consider using the Javascript library? A library will be all this unpleasantness:
$ Post ("test.asp", {'content': content}, function (data) {warning ("data returned:" + data);});
Comments
Post a Comment