Показать сообщение отдельно
  #10 (permalink)  
Старый 26.08.2013, 19:35
Аватар для bes
bes bes вне форума
Профессор
Отправить личное сообщение для bes Посмотреть профиль Найти все сообщения от bes
 
Регистрация: 22.03.2012
Сообщений: 3,744

Сообщение от 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
Ответить с цитированием