2012-04-12 53 views
0

在框架中,我使用下面的代码。但是,我总是给成功的消息根据是否提供邮件

if ($artistID) 
       NCore::db('PERSON_MOVIE')->insertAsArray(array('PERSON_ID' => $artistID->id, 'MOVIE_ID' => $movieID, 'JOB_ID' => 374)); 
      else 
       header('Location: http://www.sinemalar.com/management/artistAddEditRemove/'); 

这是消息

如何根据else语句发出的信息?这是我的js。可能会发生什么变化?

<script type="text/javascript"> 
function showMessage(a) 
{ 
alert(a); 
} 
</script> 
+0

我认为这是一个有点模糊,你的后端代码似乎要么将用户重定向或在数据库中保存的数据,它不返回任何消息中使用。 – GillesC 2012-04-12 11:51:25

回答

1

试试这个:

if(success=="a"){ 
    alert("Done") 
    }else { 
    alert("Something went wrong") 
}; 
相关问题