我的 js 脚本中有这个功能。
//handle the deleting of the shoutlines
function delete_shoutline(shoutline_number)
{
//the number of the shoutline we're deleting
var shoutline = shoutline_number;
$.post("shoutbox/delete_ban.php", {shoutline : shoutline_number},
function(result)
{
//show the result, if any
alert(result);
//refresh the page
window.location = window.location;
});
}
//handle the banning of users
function ban_user(user_ban)
{
//the name of the user we are banning
var banned = user_ban;
$.post("shoutbox/delete_ban.php", {banned : user_ban},
function(result)
{
//show the result, if any
alert(result);
//refresh the page
window.location = window.location;
});
}
这是电话
<a href='javascript: delete_shoutline(SOMEID);' title='Delete' class='delete' onclick=\"return confirm('Are you sure you want to delete this message?');\">x</a><a href='javascript: ban_user(SOMEUSER);' title='Ban' class='ban' onclick=\"return confirm('Are you sure you want to ban this user?');\">o</a>
该功能delete_shoutline
效果很好,但是当我单击禁令链接时,我的控制台会暂停并说(anonymous function) members.php (2):1
Paused on exception 'ReferenceError'
和调试器说Uncaught ReferenceError: SOMEUSER is not defined
我不是最擅长 js 所以我真的不知道这意味着什么?我不太确定这意味着什么,因为该函数是在 js.js 中定义的。