encodeURIComponent() use for pass special character in jQuery ajax post data content.
<ul>Example</ul>
<ul>Example</ul>
var email= $('#txt_email').val();
var desc = $('#txt_description').val();
jQuery.ajax({
type: "POST",
url: "ajax/save_tag.php",
data:"email="+encodeURIComponent(email)+"&desc="+encodeURIComponent(desc), beforeSend: function() { jQuery('.sending_email').append('wait. processing...');
}, success: function(html){ //html is responce } });
var desc = $('#txt_description').val();
jQuery.ajax({
type: "POST",
url: "ajax/save_tag.php",
data:"email="+encodeURIComponent(email)+"&desc="+encodeURIComponent(desc), beforeSend: function() { jQuery('.sending_email').append('wait. processing...');
}, success: function(html){ //html is responce } });
0 Comments