【发布时间】:2016-01-15 02:49:34
【问题描述】:
我试图在保存数据并将其显示在视图中时显示通知,但不运行我使用 notify.js。如果有人可以帮助我吗?
这是我的控制保存
function save() {
$data = array(
'idsupplier' => $this->input->post('idsupplier'),
'namasupplier' => $this->input->post('namasupplier'),
'alamat' => $this->input->post('alamat'),
'telp' => $this->input->post('telp'),
'fax' => $this->input->post('fax'),
'email' => $this->input->post('email'),
'web' => $this->input->post('web'),
'kontak1' => $this->input->post('kontak1'),
'hp1' => $this->input->post('hp1'),
'email1' => $this->input->post('email1'),
'kontak2' => $this->input->post('kontak2'),
'hp2' => $this->input->post('hp2'),
'email2' => $this->input->post('email2'));
$this->mcrud->addsupplier($data);
echo '<script>Notify("Alat Baru Berhasil Ditambahkan Ke Database ", null, null, type);</script>';
redirect('instrument/detailsupplier');
这是我的看法
<style>
#notifications {
cursor: pointer;
position: fixed;
right: 0px;
z-index: 9999;
bottom: 0px;
margin-bottom: 22px;
margin-right: 15px;
max-width: 300px;
}
</style>
<div id="notifications"></div>
<script>
$( document ).ready(function() {
Notify("Alat Baru Berhasil Ditambahkan Ke Database ", null, null, type);
});
</script>
【问题讨论】:
标签: javascript php twitter-bootstrap codeigniter