473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Array working in IE, not in Firefox

HaLo2FrEeEk
404 256MB
I have an array of values, variable length. I'm writing a bookmarklet to make a task simpler and I'm having an issue with the way Firefox is reading the array. Internet Explorer (8) works fine.

Basically, let's say my first array element is this:

myArray[0] = "value1",

Calling up the value should look like this:

myArray[0];

In IE that would return "value1". In Firefox it's returning the number 0. This is causing the next line to error, since it's expecting a value. I tried doing:

alert(myArray):

And it returns this in Firefox:

0,1,2,3,4,5,6,7,8,9,10,11

IE returns the actual values. Is there something I'm missing here? I need the code to work in both, but I just can't figure it out.
Jul 8 '10 #1
3 1704
HaLo2FrEeEk
404 256MB
Ugh...nevermind with this. I HAD missed something. The loop that I was assigning my array values in worked differently in Firefox that in IE, so I had to change it for Firefox and I forgot to change the value that actually assigned to the array. It works now. Sorry.
Jul 8 '10 #2
gits
5,390 Expert Mod 4TB
when it alerts that ... then the array is in fact:

Expand|Select|Wrap|Line Numbers
  1. myArray = [0,1,2,3,4,5,6,7,8,9,10,11];
  2.  
so we would need to see some code where you assign the values to the array ...

PS: ok ... you did find it out already :)
Jul 8 '10 #3
HaLo2FrEeEk
404 256MB
@gits
Yeah, I was doing a foreach loop through a tag's child elements:

for(var i in array)

In IE the value of i would be the element's ID value, in firefox it just returns the number, so I had to do this:

for(var i in array)
var value = array[i].id;

And it worked in both.
Jul 8 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: sonic_soul | last post by:
Hi, I was curious if I could make my webservice work with firefox client webservice functionality. (i got it to work with webservice.htc) I am able to get firefox to see my serverside web...
4
by: John Bullock | last post by:
Hello, I am at wit's end with an array sorting problem. I have a simple table-sorting function which must, at times, sort on columns that include entries with nothing but a space (@nbsp;). I...
5
by: hibernate | last post by:
I'm somewhat new to javascript/DHTML, and this problem has been plaguing me. I have made an 'array' of <div> tags within my html document like so: <div id="menu"> menu1 </div> <div id="menu">...
1
by: elixxir | last post by:
Hiho, I'm trying to deserialize the following XML feed from the weather channel but I'm having an issue with the nested arrays. I got as far as getting the 'day' into arrays but I can't get the...
3
by: TJS | last post by:
I am finding that the serverside requiredvalidator doesn't fire in the firefox browser, and user request proceeds through to my updateProfile method. Validation is working correctly in the IE...
2
by: fedorpawel | last post by:
I want to redirect the user to the current month such as November2006.html, but only if the month exists in pubMon array. This code works correctely in IE but stopped working in the new Firefox. In...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
3
by: geetha v | last post by:
Hi All, I need a scrolling DIV is a to display my dynamic tree in left frame. In my jsp , Div overflow is set to "auto" <DIV id=divScroller style="overflow:auto;height:200px"> <!--...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
4
by: jan verschueren | last post by:
I got the question from someone at the office. He was converting some code to php code. He saw "$var = array(-1);" somewhere. On the internets people say it's better to use (0) then (-1), but...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.