Title: demo4:bug: · Issue #2 · Bigerfe/fe-learn-code · GitHub
Open Graph Title: demo4:bug: · Issue #2 · Bigerfe/fe-learn-code
X Title: demo4:bug: · Issue #2 · Bigerfe/fe-learn-code
Description: 多文件上传 之 xhr formdata
Open Graph Description: 多文件上传 之 xhr formdata
X Description: <h1>多文件上传 之 xhr formdata</h1> <div> 选择文件(可多选): <input type="file" id="f1" multiple/><br/><br/> <button type="button" id="bt...
Opengraph URL: https://github.com/Bigerfe/fe-learn-code/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"demo4:bug:","articleBody":"```html\r\n\u003ch1\u003e多文件上传 之 xhr formdata\u003c/h1\u003e\r\n \u003cdiv\u003e\r\n 选择文件(可多选):\r\n \u003cinput type=\"file\" id=\"f1\" multiple/\u003e\u003cbr/\u003e\u003cbr/\u003e\r\n \u003cbutton type=\"button\" id=\"btn-submit\"\u003e上 传\u003c/button\u003e\r\n \u003c/div\u003e\r\n```\r\n```js\r\n var fileList = document.getElementById('f1').files;\r\n console.log(document.getElementById('title'))\r\n if(!fileList.length){\r\n alert('请选择文件');\r\n return;\r\n }\r\n var fd = new FormData(); //构造FormData对象\r\n fd.append('title', document.getElementById('title').value); \r\n```\r\n### 关于 `document.getElementById('title')` 不存在直接获取是不是有点问题?","author":{"url":"https://github.com/wangdabaoqq","@type":"Person","name":"wangdabaoqq"},"datePublished":"2019-12-02T10:19:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/fe-learn-code/issues/2"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ee566479-cc4b-1331-1dd0-eec4756fe08b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A750:24876D:122A4ED:177070C:697F9908 |
| html-safe-nonce | 2689693979a60456a3d32b81962cbb7a0cff062b5c7203e929c790f3e8ef6513 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzUwOjI0ODc2RDoxMjJBNEVEOjE3NzA3MEM6Njk3Rjk5MDgiLCJ2aXNpdG9yX2lkIjoiMzAyNDQwNzMwNDY0NTYxMzgzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aabcffe5857f07e99e20492004880f7d38fa59e17008aff6e472ecdd8133b0bf |
| hovercard-subject-tag | issue:531028054 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Bigerfe/fe-learn-code/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b90a631b58ed0200eec56029817f25aedaed35128027e7a1be92af4b75d30705/Bigerfe/fe-learn-code/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b90a631b58ed0200eec56029817f25aedaed35128027e7a1be92af4b75d30705/Bigerfe/fe-learn-code/issues/2 |
| og:image:alt | 多文件上传 之 xhr formdata 选择文件(可多选): var fileList = document.getElementById('f1')... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wangdabaoqq |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/Bigerfe/fe-learn-code git https://github.com/Bigerfe/fe-learn-code.git |
| octolytics-dimension-user_id | 16331920 |
| octolytics-dimension-user_login | Bigerfe |
| octolytics-dimension-repository_id | 215478138 |
| octolytics-dimension-repository_nwo | Bigerfe/fe-learn-code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 215478138 |
| octolytics-dimension-repository_network_root_nwo | Bigerfe/fe-learn-code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width