I have a servlet that contains a string, wherein the latter is a JSON string with multiple entries. Now I want to access this String with ajax through jQuery. Now here if my function:
function myFunction() {
    $("#myButton").click(function() {
         $.ajax({ 
             url: // servlet,
             type: "GET",
             dataType : "text",
             success: function() // I want to display the string from the servlet,
             error:  // stuff
    // other code
Anyway how can I do this. Also can I place another function in the success part rather than an anonymous function?
 
     
     
     
     
    