Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Learn More

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Enable null values assignments in javascript..without stopping the program flow. Same code is ok in IE8

  • 1 відповідь
  • 1 має цю проблему
  • 12 переглядів
  • Остання відповідь від cor-el

more options

I have the following code which is falling over in Firefox, while in other browsers like IE, Chrome and Opera is passing through even though the value in the array at that point of time is null.

var vitemp = document.getElementById('F06_'+ij).value;

In firefox, i get the error below.

[18:59:35.747] TypeError: document.getElementById(...) is null @ http://

How can i change the firefox parameters so as to be less strict for null value assignments ?

I have the following code which is falling over in Firefox, while in other browsers like IE, Chrome and Opera is passing through even though the value in the array at that point of time is null. var vitemp = document.getElementById('F06_'+ij).value; In firefox, i get the error below. [18:59:35.747] TypeError: document.getElementById(...) is null @ http:// How can i change the firefox parameters so as to be less strict for null value assignments ?

Усі відповіді (1)

more options

Use code like this to test if that id exists.

var vi_id = document.getElementById('F06_'+ij);
var vitemp = vi_id?vi_id.value:null;