We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function urlController(url) { var _url = url.split("?")[1]; if (!_url) { return {}; } var windowHref = _url.split("&"); var obj = {}; for (var i = 0; i < windowHref.length; i++) { var arr = windowHref[i].split("="); obj[arr[0]] = decodeURIComponent(arr[1]) // 路由解码 } return obj; }
function objectToQueryString(obj) { var qstring = "?", i = 0; for (var key in obj) { if(i>0) qstring += "&"; qstring += key + "=" + obj[key]; i++; } return qstring }
triggerDownload: function(content, filename) { var eleLink = document.createElement('a'); eleLink.download = filename; eleLink.style.display = 'none'; eleLink.href = content; document.body.appendChild(eleLink); eleLink.click(); document.body.removeChild(eleLink); }
var tools = { jsonToArray: function (data) { var arr = []; for (var key in data) { arr.push(data[key]) } return arr; }, arrayToJson: function(data, key){ var obj = {}; var keyV = key ? key : 'code'; data.map(function (e, item) { obj[e[keyV]] = e; }); return obj; }, }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
window.location
Get URL and URL Parts in JavaScript
The text was updated successfully, but these errors were encountered: