Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Client side of AJAX string reverse

<form>
<input name="str" id="str">
<input type="submit" id="reverse" value="Reverse">
</form>


<script>
    $("#reverse").click(function() {
        var str = $("#str").val();
        jQuery.get('http://127.0.0.1:5000/api/v2/reverse?str=' + encodeURIComponent(str) , function(data) {
            console.log(data);
            $("#msg").html(data["text"]);
        });
       return false;
    });
</script>

Try: [v2](file:///Users/gabor/work/D2-Ajax/client/v2.html“ %}