JavaScript Posting a value that contains too many charcters and & char post value in php,post value in pega,post value

I am trying to post some data to a php file by using following code.

var exam = document.getElementById("information").getAttribute("examid");
            var user = document.getElementById("information").getAttribute("userid");
            var question = document.getElementById("information").getAttribute("questionid");

            var xmlhttp;
            xmlhttp=new XMLHttpRequest();
            xmlhttp.open("GET","savevalue.php?examid="+exam+"&userid="+user+"&questionid="+question+"&content="+ editor.getValue(),true);
            xmlhttp.send();
            xmlhttp.onreadystatechange=function()
            {
               if (xmlhttp.readyState==4 && xmlhttp.status==200)
              {

              }
            }

But the first problem is if the variable that I am posting contains too many characters, this method fails. Secondly if one of the variables that I am posting contains '&' char, it also fail. Should I replace & with something else?

Answer:1

I am developing a web page in which a user can use a barcode scanner to scan a QR code. I am using the following code to capture the contents of the QR code: $(document).ready(function () { var ...

I am developing a web page in which a user can use a barcode scanner to scan a QR code. I am using the following code to capture the contents of the QR code: $(document).ready(function () { var ...

I would like to ask a question about event handlers when used in HTML and React. In the book Javascript and Jquery written by Jon Duckett, the author mentioned that using HTML event handler attribute ...

I would like to ask a question about event handlers when used in HTML and React. In the book Javascript and Jquery written by Jon Duckett, the author mentioned that using HTML event handler attribute ...

  1. html event handler attributes
  2. html event handler javascript
  3. html event handler
  4. html event handler return value
  5. html event handler parameters
  6. html event handler list
  7. html event handler arguments
  8. html event handler xss
  9. html event handler dropdown
  10. html event handler input
  11. html event handler remove
  12. html click event handler
  13. html inline event handler
  14. html button event handler
  15. html checkbox event handler
  16. html select event handler
  17. html add event handler
  18. html onclick event handler
  19. html form event handler
  20. html submit event handler

Hello im trying to use Math.min but i am getting NaN as a result, this is the code. method using Math.min method() { var DeltaPrueba = this._markerService.getDeltasRx1(); console.log(DeltaPrueba); ...

Hello im trying to use Math.min but i am getting NaN as a result, this is the code. method using Math.min method() { var DeltaPrueba = this._markerService.getDeltasRx1(); console.log(DeltaPrueba); ...

I have two types of Strings like the following : 78:24207 PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180 or 78:27247 PERF create tab state : 1502876879180 I'm looking ...

I have two types of Strings like the following : 78:24207 PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180 or 78:27247 PERF create tab state : 1502876879180 I'm looking ...