Am trying to send some a value i.e. fileShareName to Servlet through this code but am unable to send it .Please guide me ..
Here is am having the code : 
function shareFileName(){
    var fileShareName = $('#newpathlocation').find(":selected").text();
    row = "";
    $
            .ajax({
                url : '../directory',
                type : 'POST',
                data : {'fileName' : fileShareName},
                datatype : String,
                beforeSend: function( fileShareName ){},
                success : function(fileShareName) {
                        alert("Success");
                    },
                error : function(fileShareName) {
                    alert("Error");
                }
            });
}
 
    