-
Notifications
You must be signed in to change notification settings - Fork 2
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
week7 homework #15
week7 homework #15
Conversation
@@ -58,7 +55,7 @@ | |||
<div class="btn btn-success todo__done">完成</div> | |||
<div class="btn btn-danger todo__delete">刪除</div> | |||
</div> | |||
</li>` // 為什麼這邊要用 ` ${}是 jQuery 的獨有用法嗎? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這問題沒看懂,不確定你在問哪裡XD
@@ -78,7 +75,7 @@ | |||
<div class="input-group-prepend"> | |||
<span class="input-group-text" id="basic-addon1">Add new todo</span> | |||
</div> | |||
<input type="text" required="required" class="form-control add-todo" placeholder="todo" aria-label="todo" aria-describedby="basic-addon1"><!-- aria 無障礙設計 --> <!-- 為什麼 requried 沒有用? --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因為這不是個表單,所以 required 沒用
$comment_nickname=$read_comment_row['nickname']; | ||
$comment_time=$read_comment_row['created_at']; | ||
$comment_id = $read_comment_row['id']; | ||
$conn->close(); //這個的作用是什麼? 沒 close 會怎麼樣? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
就有些資源會多留一陣子才被釋放
type: "POST", | ||
url: 'comment.php', | ||
data: { | ||
comment_content: comment_content,/* 會不會有 XSS 的問題? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你只要 render 的時候有先 escape 就不會
都沒什麼問題,你卡關的那個問題你可以想想以下範例: $('.test').click(function(){
alert('test')
})
$('body').append('<div class="test">click me</div>') 程式是按照順序跑的,所以你在跑第一行的時候, 解法就是你查到的那個,用 on 來代替,這叫做 event delegation。 |
Week7 作業三,在完成 AJAX 功能之後,才使用 Bootstrap 修改版面,因為更動了 HTML 結構,所以有兩個版本。
本週完成事項
Week 6 檢討
複習
Week 7 進度
解決方法:使用 jQuery 改變 DOM 元素後 Click Event 失效問題的解決方法
但不清楚為什麼
本週心得