私は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で定義されているため、これが何を意味するのかよくわかりません。