Skip to content
New issue

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

post数据请求其中的一个方法有点不完善 #77

Open
tanggd opened this issue Dec 29, 2020 · 0 comments
Open

post数据请求其中的一个方法有点不完善 #77

tanggd opened this issue Dec 29, 2020 · 0 comments

Comments

@tanggd
Copy link

tanggd commented Dec 29, 2020

作者你好,我正在学习你的这个教程
post数据请求其中的一个方法有点不完善

function parseQueryStr( queryStr ) {
  let queryData = {}
  let queryStrList = queryStr.split('&')
  console.log( queryStrList )
  for (  let [ index, queryStr ] of queryStrList.entries()  ) {
    let itemList = queryStr.split('=')
    queryData[ itemList[0] ] = decodeURIComponent(itemList[1])
  }
  return queryData
}

这个方法没有考虑到checkbox复选框的情况。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant