Correct way to blank a text value in an array?

S

Sam Wuebben

What is the correct way of setting a text item in an array to be a
blank so that IE for XP will display it as a blank?

I have an array of 12 text items. Sometimes one of the vaules needs to
be set to and display as a blank.
The array is initially set up as 12 items and with some being set as
blank spaces:

myarray=new Array('one','two','three','fourth item','fifth
item','sixth item','','','','','','');

document.write(myarray[3]);

displays the phrase fourth item

and

document.write(myarray[8]);

gives a blank, even in IE for XP.

However:

If I try to set the fourth item to be a blank using

myarray[3] = ''; //two single quotes. two double-quotes gives the
same results

and try to display myaray[3] using:

document.write(myarray[3]);

in IE for XP I keep getting a null.

And the others values in the array after it are undefined. It is as if
when you set an array item to be '' (two single quotes) then IE for
windows erases that part of the array.

All other browsers give a blank space and the array stays intact.

I've tried everything and looked everywhere.

So, what is the correct way of setting a text item in an array to be a
blank so that IE for XP will display the blank?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top