我有this ajax function jquery。 (http://pastie.org/798788)如何使用jQuery生成ajax後執行另一個動作?
輸出結果如下。
<div class="content">
<h1>Latest Messages or Task To Do</h1>
<ul style="display: block;" id="message_ul">
<li class="86">
<div class="listbox"><span class="user">
<strong>Administrator</strong></span>
<span class="date">2010-01-28 08:57:43</span>
<a href="http://127.0.0.1/ci_backendpro2/index.php/messages/admin/changestatus/86"
class="todo">to do</a>
<span class="msg">Change links in message, to do, completed
and delete to anchor </span>
</div>
</li>
<li class="85">
<div class="listbox"><span class="user">
<strong>Administrator</strong></span>
<span class="date">2010-01-28 08:51:15</span>
<a href="http://127.0.0.1/ci_backendpro2/index.php/messages/admin/changestatus/85"
class="todo">to do</a>
<span class="msg"> meta tag keywords and
description should show from page input/database </span>
</div>
</li>
<li class="84">
...
...
現在我正在嘗試添加class =「todo」的另一個ajax。但是,當我嘗試這個測試。它不警告。它執行php函數。
$(".todo").click(function(){
event.preventDefault();
alert("hei");
});
我不知道爲什麼。是因爲它是由ajax創建的嗎?
是否與綁定有關?
我該如何讓它工作?
我很感謝您的幫助。
附加信息。 順便說一句,我使用codeigniter。 其他php functions are here。 (http://pastie.org/798802)
就是這樣。謝謝。 – shin 2010-01-28 15:07:32