javascript - Ajax request only posting part of the text -


I have the following AJAX script (prototype JS), but it is only posting part of the text.

  selenium.prototype.dow copy paste = function (locator) {var element = this.page (). Find Element (Locator); Var text = jQuery (element) .text (); Console.log (text); Var ajax = new Ajax.Request ('http: //copypaste.test', {method: 'post', parameter: 'report =' + text, processData: false, onSuccess: function (transport) {var response = transport response The text "is no response"; Warning ("Success! \ N \ n" + response);} Failure: Action () {Warning ('Something went wrong ...'}}}}); Console.log (ajax);}  

When I get the output text in the console, I get everything that is locator Is passed through, an example

  ------------------------------ - ------------- --------------- & lt; br & gt; Header 1 & lt; br & gt; ------ -------------------------------------------- ------ <- Header 2: Another name & lt; br & gt; Sub title 3: Here the data for about 3000 characters & lt; br & gt; etc. I realize that there is no string here and this can be why the problems are IM .. then how can I send all the data in my PHP script? .    if ($ _POST ['report']) {echo $ _POST ['report']; }  

You must notify your string before posting it:

... Parameter: 'report =' + encodeurIC component (text); ...

Now characters in your string can invalidate it, divide it into several key-value areas.


Comments