"F. Da Costa" <dacosta@xs4all.nl> writes:
[color=blue]
> I was wondering whether someone could enlighten me as to the reason
> why the slice does not work in IE when the arr is passed in properly.[/color]
It works for me. Need more detail.
[color=blue]
> Checked the values in the srcArr and they are correct so no problems there.[/color]
What is the correct value?
[color=blue]
> Gecko works as expected.[/color]
What is the expected result?
[color=blue]
> Prior to entering the function I can slice the array being entered so
> I wouldn't expect an "Unexpected call to method or property access"
> (in IE 6).[/color]
Ok. Do you slice it?
[color=blue]
> I guess its something silly but as of yet i'm not seeing it.
> Any suggestions would be appreciated.[/color]
[color=blue]
> function insertIntoArray(srcArr, insLoc, repl, insObj) {
> alert(srcArr.slice(0,2));
> var top = (repl) ? srcArr.slice(0, insLoc) : srcArr.slice(0, insLoc1);[/color]
Undefined variable "insLoc1", should be "insLoc" or "insLoc+1"? If
"insLoc", the branches are equal. If "insLoc+1", the insObj is
inserted *after* the insLoc'th element.
[color=blue]
> var end = (repl) ? srcArr.slice(insLoc+1) srcArr.slice(insLoc+1);[/color]
^ missing ":"
The branches are equal, so no need for conditional expression.
[color=blue]
> return top.concat(insObj, end);
> }[/color]
The code is syntactically incorrect. Please post the actual code that
fails, and say what you do (the actual values of the arguments that
fail), what you expect to happen (the final result, or even the vlaues
of top and end), and what actually happens.
Then I'm sure we will be able to help you. Until we have that information,
all we can do is guess (and while it sometimes seems that way, we are not
oracles :)
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'