Invalid argument error in IE

Discussion in 'Javascript' started by shalinmangar, Aug 10, 2006.

  1. shalinmangar

    shalinmangar Guest

    Hi,

    I have created two javascript classes in the following way.

    //Script tag starts here

    function ClassA(textBoxID, objB) {
    this.textBox = document.getElementById(textBoxID);
    this.objB = objB;

    //some other methods
    }

    function ClassB() {
    this.propertyA = "some value";

    //some other methods
    }

    var objA = null, objB = null;

    function body_onLoad() {
    objB = new ClassB();

    objA = new ClassA("aTextBoxID", objB);
    }

    //Script tag ends here

    This approach runs as expected in Firefox but in Internet Explorer, I
    get a script error "Invalid Argument" at a line number which contains
    the script's closing tag.

    Can anybody enlighten me about what may be the problem with this code?

    Regards,
    Shalin.
    shalinmangar, Aug 10, 2006
    #1
    1. Advertising

  2. shalinmangar

    Noah Sussman Guest

    When I call body_onLoad() in IE 6, I don't get an error; and objB and
    objA both get defined. Perhaps you should post the complete code?


    shalinmangar wrote:
    > Hi,
    >
    > I have created two javascript classes in the following way.
    >
    > //Script tag starts here
    >
    > function ClassA(textBoxID, objB) {
    > this.textBox = document.getElementById(textBoxID);
    > this.objB = objB;
    >
    > //some other methods
    > }
    >
    > function ClassB() {
    > this.propertyA = "some value";
    >
    > //some other methods
    > }
    >
    > var objA = null, objB = null;
    >
    > function body_onLoad() {
    > objB = new ClassB();
    >
    > objA = new ClassA("aTextBoxID", objB);
    > }
    >
    > //Script tag ends here
    >
    > This approach runs as expected in Firefox but in Internet Explorer, I
    > get a script error "Invalid Argument" at a line number which contains
    > the script's closing tag.
    >
    > Can anybody enlighten me about what may be the problem with this code?
    >
    > Regards,
    > Shalin.
    Noah Sussman, Aug 10, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    529
  2. Patrick.O.Ige
    Replies:
    1
    Views:
    1,951
    Patrick.O.Ige
    Jul 2, 2006
  3. Java Guy
    Replies:
    1
    Views:
    679
    Manish Pandit
    Oct 15, 2006
  4. Java Guy
    Replies:
    1
    Views:
    305
  5. Replies:
    7
    Views:
    175
Loading...

Share This Page