JavaScript函数警报框在Firefox中不起作用
我的JavaScript中有以下代码,将显示一个警报框。 该代码在Google Chrome和IE中运行良好,但在Firefox中不起作用JavaScript函数警报框在Firefox中不起作用,javascript,php,Javascript,Php,我的JavaScript中有以下代码,将显示一个警报框。 该代码在Google Chrome和IE中运行良好,但在Firefox中不起作用 $(document).ready( function() { jAlert('You have already selected <?php echo $int; ?> theme.\nPlease deselect one of the themes to choose a ne
$(document).ready( function() {
jAlert('You have already selected <?php echo $int; ?> theme.\nPlease deselect one of the themes to choose a new theme.', 'Number Of Theme Exceeded');
});
return false;
$(文档).ready(函数(){
jAlert('您已经选择了主题。\n请取消选择其中一个主题以选择新主题。','超出主题数');
});
返回false;
我怎样才能更改它,使其在Firefox中工作?从您的问题中很难找到错误。因为我不知道你的
jAlert
的代码。但这背后可能有很多原因
首先:检查您的jQuery
版本和浏览器兼容性
Second:您的浏览器版本(旧/新)
从你的代码来看,有一件事似乎是正确的。您返回false代码>在您的功能之外。应该是这样的-
$(document).ready( function() {
jAlert('You have already selected <?php echo $int; ?> theme.\nPlease deselect one of the themes to choose a new theme.', 'Number Of Theme Exceeded');
//return false;
/*
return false should be inside of some function.
If you are copy this code from somewhere then comment this line.
*/
});
$(文档).ready(函数(){
jAlert('您已经选择了主题。\n请取消选择其中一个主题以选择新主题。','超出主题数');
//返回false;
/*
return false应该位于某个函数的内部。
如果您是从某处复制此代码,请注释这一行。
*/
});
把你的jAlert
函数的代码放进去。我想你用这个插件吧?添加此选项是否有帮助:$('body').jAlert(…
?我知道您为什么在函数之外使用返回false;
?如果您使用的是最新版本的firefox
,您应该能够使用开发者控制台。点击F12
。查看控制台,看看是否有任何错误