Javascript 根据if检查给出消息
在一个框架中,我使用以下代码。然而,我总是传递成功的信息Javascript 根据if检查给出消息,javascript,Javascript,在一个框架中,我使用以下代码。然而,我总是传递成功的信息 if ($artistID) NCore::db('PERSON_MOVIE')->insertAsArray(array('PERSON_ID' => $artistID->id, 'MOVIE_ID' => $movieID, 'JOB_ID' => 374)); else header('Location: ht
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>
函数showMessage(a)
{
警报(a);
}
试试这个:
if(success=="a"){
alert("Done")
}else {
alert("Something went wrong")
};
我认为这有点模糊,您的后端代码似乎要么重定向用户,要么将数据保存在数据库中,它不会返回任何要使用的消息。