jQuery .ajax() POST without appending data to URL
Hey there,
I'm new to jQuery, but used to working with PHP and how it sends POST data. In the following snippet, why is it that although .ajax()
data is sent to "post", it still appends all the data to the URL? Isn't that how GET works, and not POST? The reason I specify POST is so that the data
won't be sent through the URL.
- if(checkLen(50,2,'ne','input') == false && checkLen(100,0,'nst','textarea') == false && checkLen(10000,5,'nd','textarea') == false) {
- var ne = $('#add_entry input[name=ne]').val();
- var nt = $('#add_entry select[name=nt]').val();
- var nst = $('#add_entry textarea[name=nst]').val();
- var nd = $('#add_entry textarea[name=nd]').val();
-
- $.ajax({
- type: "POST",
- url: "add_entry.php",
- data: "ne=" + ne + "& nt=" + nt + "nst=" + nst + "nd=" + nd,
- success: function(){
- //success (not finished)
- }
- });
- return false;
- }