I have a problem with my jQuery script that send data via POST method. The problem is whenever it sends data via Ajax that has an "&" ampersand in the sentence, it will cut the sentence when found "&".
Please check the images below for more info.
While we may not be able to jump on the next plane to an island-getaway, we all can escape from reality mentally. Because every mind is different, it may take some trial and error to find out how you best are able to mentally escape reality.
Escapism is mental diversion from unpleasant or boring aspects of daily life, typically through activities involving imagination or entertainment. Escapism may be used to occupy one's self away from persistent feelings of depression or general sadness.
htmlentites
This function is identical to htmlspecialchars() in all ways, except with htmlentites(), all characters which have HTML character entity equivalents are translated into these entities.
If you're wanting to decode instead (the reverse) you can use html_entity_decode().
Example:
echo htmlentities("&"); // &
if your directly doing this in the browser you should be able to use:
encodeURIComponent(string input);
Example:
encodeURIComponent($.trim($("input[name=t-tim_rendered-"+id+"]").val().toString()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With