Сообщение от Madrabit
|
Нашел затыку.
if (document.getElementById("ctl00_ContentMainPage_ct lSeparateProduct_pnlOutofStock") !="undefined")
Косяк вышел из-за моего непонимания чем отличаются null от undefined
|
тест
<body>
<script>
var some_id = document.getElementById("some_id");
alert(some_id);
if (some_id === null) {
alert("id is null");
} else {
alert("id is not null");
}
if (some_id == undefined) {
alert("id is undefined");
} else {
alert("id is not undefined");
}
if (some_id == 'undefined') {
alert("id is 'undefined'");
} else {
alert("id is not 'undefined'");
}
</script>
читать, как минимум, отсюда
http://es5.javascript.ru/x12.html#x12.5