Skip to content Skip to sidebar Skip to footer

How To Retrieve A Variable Using Request.query

In my client-side code, I called getContents(): $.getJSon('/getContents', function(room){ theRoom=$('#roomName').val();//textarea's value ... }); In getContents(), which is in t

Solution 1:

You can pass it as a request param to $.getJSON() using

$.getJSON("/getContents", {
    room: $("#roomName").val()
}, function (room) {
    //rest of code
});

Note: not sure about the serverside syntax to read the request parameter, see this answer

Post a Comment for "How To Retrieve A Variable Using Request.query"