<script>
window.onbeforeunload = function (e) {
var e = e || window.event;
// For IE and Firefox
if (e) {
e.returnValue = 'Вы действительно хотите закрыть это окошко?';
}
// For Safari
return 'Вы действительно хотите закрыть это окошко?';
};
</script>
<script>
window.onbeforeunload = function (e) {
var e = e || window.event;
// For IE and Firefox
if (e) {
e.returnValue = 'Вы действительно хотите закрыть это окошко?';
}
// For Safari
return 'Вы действительно хотите закрыть это окошко?';
};
</script>
new - ключевое слово и его нельзя использовать в качестве идентификатора.
Код:
ecma 262-3 # В 262-5 есть некоторые изменения
7.5.1 Reserved Words
Reserved words cannot be used as identifiers.
ReservedWord ::
Keyword
FutureReservedWord
NullLiteral
BooleanLiteral
7.5.2 Keywords
The following tokens are ECMAScript keywords and may not be used as identifiers
in ECMAScript programs.
Keyword :: one of
break else new var
case finally return void
catch for switch while
continue function this with
default if throw
delete in try
do instanceof typeof
7.5.3 Future Reserved Words
The following words are used as keywords in proposed extensions and are therefore reserved
to allow for the possibility of future adoption of those extensions.
FutureReservedWord :: one of
abstract enum int short
boolean export interface static
byte extends long super
char final native synchronized
class float package throws
const goto private transient
debugger implements protected volatile
double import public
7.8.1 Null Literals
NullLiteral ::
null
7.8.2 Boolean Literals
BooleanLiteral ::
true
false
а есть редактор под яваскрипт и хтмл чтобы ошибки показывал типа как конпилятор под с++?
а то я заплакался целый день искать пропущеную кавычку или ;.
пользуюсь PSPad