function NodeViewModel() { var self = this; // handle requests to create a new node. $(".modal-node button").click(function(e) { var addr = $(".modal-node input").val(); var node = { address: addr }; $.ajax({ url: "/api/nodes", type: "POST", contentType: "application/json", data: JSON.stringify(node), success: function( data ) { // clears the form value $(".modal-node input").val(""); var el = $("
").attr("class", "card-text").text(data.architecture) ).append( $("