Last active
December 12, 2015 01:49
-
-
Save kevinseelbach/4694143 to your computer and use it in GitHub Desktop.
Join array elements with specified, different prepended and appended strings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gophone = function() { | |
var generateQuery, query, queryString, searchColumns, url, val; | |
val = document.getElementById("val_e").value.replace(/\D/g,''); | |
queryString = void 0; | |
url = void 0; | |
searchColumns = "583.587.528.531.754.685.571.564.565.570.529.530.684.574.566.531".split("."); | |
generateQuery = function(str) { | |
return "{'" + str + "'.CT.'" + val + "'}"; | |
}; | |
query = searchColumns.map(generateQuery).join("OR"); | |
queryString = query; | |
url = "bfzq4xh38?a=s&query=" + queryString + "&qid=1"; | |
location.href = url; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment