[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3638
  • Last Modified:

Invalid Argument Scripting Error in IE 6 + 7

I'm getting a JavaScript "scripting error" that shows up in IE 6 and 7, but parses just fine in every other browser that I checked it against (Safari, Firefox 1, Firefox 2, Opera, Camino). I put scripting error in quotes  because it's not really causing any problems that I can detect and everything appears to run just fine. The page also checks out fine in Firebug with no issues. Even though the page seems to run fine, it triggers IE's script alert errors with the following message:

The script alert error reads like this:
Line: 1
Char: 1
Error: Invalid Argument
Code: 0
URL: http://www.hyperlinked.com/devsites/index.html

Here's the webpage where I'm having the issues on.
http://www.hyperlinked.com/devsites/index.html

There are two JavaScript effects that are employed on this page. One is a slideshow effect that crossfades one image into the next. The other is a Marquee effect that animates a rotating set of quotes in the lower right corner of the homepage.

I've isolated the problem to the code that controls the Marquee effect. If you view the code, the Marquee code is this part:

var fxmq = new Fx.Marquee($('quotes'), {
      duration: 600,
      showEffect: {
            top: [0,0], //reset the top every time to zero
            left: [0, 0],
            opacity: [0,1]
      },
      hideEffect: {
            top: 20
      },
      revertEffect: {
            top: [-10, 0],
            left: [0,0] //reset the left back to zero on revert
      }
});

var showQuotes = function() {
      if ($type(messages[i]) == "object") {
            fxmq.announce({
                  message: messages[i].message,
                  delay: showTime, revert: false
            });
      }

      i++;

      if (i==messages.length) { i=0; delayTime = interval * messages.length;}
      runQuotes();
}

var runQuotes = function(){
      setTimeout("showQuotes()",interval);
      interval = showTime;
}
//showQuotes();
setTimeout("runQuotes()",delayTime);
---------
Dependencies for this code are:
http://www.hyperlinked.com/devsites/fx.marquee.js
http://www.hyperlinked.com/devsites/mootools_fulltext.js

Again, this error is not causing any problems in the script. Benign or not, I just don't want there to be an scripting error alert that pops-up when someone in IE comes across the site. The part that really has me confused is that IE seems to think there's a scripting error on the index.html file on line 1 at character 1. How is that even possible?
0
smirking
Asked:
smirking
  • 3
1 Solution
 
Michel PlungjanIT ExpertCommented:
It is here:

this.style[property]=value

in the mootools.

I have seen this before and my guess is a different interpretation of some css in IE versus the rest.

I will try and find the reason...
0
 
Michel PlungjanIT ExpertCommented:
I did not find any solution.

I found that initially the mootools cannot find the top of the div named option so this code fails

this.style[property] = value;

If I do this:

try {
            this.style[property] = value;
}
catch(e) {
//  alert(this.className + ':'+property+'='+value)
}


you will not get the error.


The error comes from Fx.Styles.js

      increase: function(){
            for (var p in this.now) {
                  //    if (p=='top') alert(p+':'+this.css[p].getValue(this.now[p], this.options.unit, p))
              this.element.setStyle(p, this.css[p].getValue(this.now[p], this.options.unit, p));
            }
      }

perhaps someone with more time than I can figure it out.
I have attached the test page
testmoo.html.txt
0
 
smirkingAuthor Commented:
Thanks! That did the trick. I'm not really all that worried about the robust solution. This is a BS bug that's not causing any real problems other than the non-congenial scripting error alert. I'm not keen on wasting more time or asking others to waste time digging this out.
0
 
Michel PlungjanIT ExpertCommented:
Pasting the user comment: "Thanks! That did the trick. I'm not really all that worried about the robust solution. This is a BS bug that's not causing any real problems other than the non-congenial scripting error alert. I'm not keen on wasting more time or asking others to waste time digging this out."
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now