function NodeViewModel() { var self = this; // handle requests to create a new node. $(".modal-node button").click(function(e) { var node = { address : $("#addr").val(), key : $("#key").val(), cert : $("#cert").val(), ca : $("#ca").val() }; $.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( $("