[英]Why do I keep getting this error: Error: Email is badly formatted?
在我的網站上輸入這個 email 地址 (danidust277@gmail.com) 時,我一直收到這個錯誤。 為什么?
HTML:
<div>
<input type="text" id="update_profile_displayname" placeholder="Display Name"><br></br>
<input type="email" id="update_profile_email" placeholder="Email Address"><br></br>
<button type="button" type="submit" id="update_profile_submit">Save changes</button>
</div>
記者:
var update_email = document.getElementById("update_profile_email");
var update_name = document.getElementById("update_profile_displayname");
user.updateEmail('update_email').then(function() {
}).catch(function(error) {
console.log(error)
window.alert(`An error occured:${error}`);
})
我猜user.updateEmail
是一種接受有效 email 地址作為參數的方法。 在這種情況下,您不應傳遞字符串 'update_email',而應傳遞輸入字段的值,這會導致user.updateEmail(update_email.value)
。 你已經嘗試過了嗎?
我認為您應該將update_email.value
作為參數傳遞給user.updateEmail
,就像上面的 Davide Bulbarelli 所說的那樣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.