Jump to content

javascript function problem IE6/Firefox


paul2463

Recommended Posts

Hello all hopefully you can point me in the right direction, I have this function that turns a string into an array and here is the code:-
[code]
answer = "Hello, how are you doing";
var lettArray = new Array();
for (var i=0; i<answer.length; i++) {
lettArray.push (answer[i]);
}
alert(lettArray);
[/code]

now when i run it in Firefox I get an alert box that says
[code]
,H,e,l,l,o,,, ,h,o,w, ,a,r,e, ,y,o,u, ,d,o,i,n,g,
[/code]
as expected, but if I run it using Internet Explorere 6 I get the following
[code]
,,,,,,,,,,,,,,,,,,,,,,,,,
[/code]

I am pulling my hair out can someone please explain me to me in small words whats happening??
Link to comment
https://forums.phpfreaks.com/topic/26867-javascript-function-problem-ie6firefox/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.