W3C 有規範瀏覽器遇到 HTML tag 問題時,是如何處理的。
詳細文件:HTML#Parse errors
自己試著用 Deno 寫小機器人
不過不管試幾次,登入後去其他 request 都做不到
我的 code 大致如下
const account = "foo@example.com"
const password = "bar123456789"
const host = "http://localhost:8080"
let cookie = await fetch(`${host}/login`, {
body: `account=${account}&password=${password}`,
method: "POST",
headers: {"Content-type": "application/x-www-form-urlencoded"}
})
.then(function(resp){
return resp.headers.get("Set-cookies") || "" // 不加上 || "" 的話,cookie 就會被視作 nullable 變數,在 deno 可能會說 warning 或 error
})
fetch(`${host}/some-request`, {
headers: {"Cookie": cookie}
})
.then(function(resp){
return resp.text()
}).then(function(data){
console.log(data)
})
以上這段 code 最終會 redirect 到首頁而已
因為 cookie 取不到(換言之, cookie 變數一直都會是空字串)
今天在搜尋某些資料時,發現到一個叫「程序猿甜品店」的網站。
這網站有個很有趣的效果:當你瀏覽器轉到其他分頁時,該網站的 tab 標題會變成「我失宠了」;如果回到該 tab,又會變成「我被宠了」(維持2秒,之後變回原本標題)。
[DOM] Input elements should have autocomplete attributes (suggested: "current-password"): (More info: https://goo.gl/9p2vKq)
This page includes a password or credit card input in a non-secure context. A warning has been added to the URL bar. For more information, see https://goo.gl/zmWq3m.
根據 W3C 的規則, HTML5 新增的 <article> 、 <section> 這兩個 tag,裡面必須包含 <h2 ~ 6>
要不是我會去使用 The W3C Markup Validation Service 幾乎不會知道地說
是說, w3school 完全沒有告知這個呢
參考資料:HTML/Usage/Headings/Missing - W3C Wikienctype="multipart/form-data"來顯示