php - & Value not appearing with AJAX call -


i working on submitting values database through ajax. uses jquery ajax object.my ajax code looks this:

enter code here 

var genre = form.new_album_genre.value; form.new_album_genre.value="";

$.ajax({     type: "post",     data: "genre="+genre+"&app="+app,     url: 'apps/pvelectronicpresskitadmin/ajax_add_album_genre.php',     success: function(data) {     $('#'+divid).html(data); 

} });

in short, gets value form , submits data through post. fails if genre r&b. & symbol not sumbitting , r is. how submit values through ajax including &, + , = ?

you need encodeuricomponent deal characters have special meaning in uris.

(or pass object containing key/value pairs jquery instead of query string string have now)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -