From ac0dfa7d819131384f7afe2ec93a752bd7d39a1e Mon Sep 17 00:00:00 2001 From: Behind The Math Date: Fri, 27 Apr 2018 09:44:37 -0400 Subject: [PATCH] Code cleanup --- lib/proto/attach-form.js | 3 +-- lib/send-request.js | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/proto/attach-form.js b/lib/proto/attach-form.js index d194d81..44c4d48 100644 --- a/lib/proto/attach-form.js +++ b/lib/proto/attach-form.js @@ -15,8 +15,7 @@ var formAction = function(el, event) { // Initialize requestOptions options.requestOptions = { requestUrl: el.getAttribute("action") || window.location.href, - requestMethod: el.getAttribute("method") || "GET", - requestParams: [] + requestMethod: el.getAttribute("method") || "GET" } // create a testable virtual link of the form action diff --git a/lib/send-request.js b/lib/send-request.js index c7e5a6a..11b88c4 100644 --- a/lib/send-request.js +++ b/lib/send-request.js @@ -6,6 +6,7 @@ module.exports = function(location, options, callback) { var requestOptions = options.requestOptions || {} var requestMethod = (requestOptions.requestMethod || "GET").toUpperCase() var requestParams = requestOptions.requestParams || null + var formData = requestOptions.formData || null; var requestPayload = null var request = new XMLHttpRequest() var timeout = options.timeout || 0 @@ -51,8 +52,8 @@ module.exports = function(location, options, callback) { break } } - else if (requestOptions.formData) { - requestPayload = requestOptions.formData + else if (formData) { + requestPayload = formData } // Add a timestamp as part of the query string if cache busting is enabled