3
我正在嘗試將一個簡單的JavaScript代碼段寫入Codeigniter鏈接。我正在使用該鏈接刪除我的信息中心所需的帖子。我不知道任何關於JS的知識,儘管我正在努力學習它。將JS添加到Codeigniter鏈接 - 簡單的OnClick
代碼
$js = 'onClick = "alert("Are you sure")"';
$this->table->set_heading('Date', 'Title', 'Delete', 'Update');
foreach($records as $row){
$row->title = ucwords($row->title);
$this->table->add_row($row->date,
$row->title = ucwords($row->title),
anchor("main/delete/$row->id", $row->id, $js), //this is the link in question
anchor("main/fill_form/$row->id", $row->id)
);
}
$table = $this->table->generate();
echo $table;
我的問題是如何寫JS的鏈接($ JS)。我想使用確認聲明(是或否)。我完全與JS失去了防止意外刪除
謝謝
非常感謝你。我應該很早以前就學會了JS。您讚賞 – Brad 2010-08-13 17:03:17
偉大的:-)很高興幫助。 – 2010-08-13 19:26:39