Loading ...
Sorry, an error occurred while loading the content.

Document Object

Expand Messages
  • -
    In my external JS file, I use the following code: document.getElementById( element ).innerHTML = object.property; I receive both of the follower errors from JS
    Message 1 of 2 , Sep 22, 2008
    • 0 Attachment
      In my external JS file, I use the following code:

      document.getElementById('element').innerHTML = object.property;

      I receive both of the follower errors from JS Lint.

      Implied global: document

      AND

      'document' is undefined.

      I tried several corrective actions including to create an object named object, and define a variable named object. When I do this, the code passes validation but cases my page to not
      render in Fire Fox. Didn't check it in IE yet.

      How should I "define" the document object??
    • Douglas Crockford
      ... named object, and define a variable named object. When I do this, the code passes validation but cases my page to not ... Use the Assume a Browser option.
      Message 2 of 2 , Sep 23, 2008
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "-" <iamjang2003@...> wrote:
        >
        > In my external JS file, I use the following code:
        >
        > document.getElementById('element').innerHTML = object.property;
        >
        > I receive both of the follower errors from JS Lint.
        >
        > Implied global: document
        >
        > AND
        >
        > 'document' is undefined.
        >
        > I tried several corrective actions including to create an object
        named object, and define a variable named object. When I do this, the
        code passes validation but cases my page to not
        > render in Fire Fox. Didn't check it in IE yet.

        Use the Assume a Browser option. document is not a JavaScript object.
        It is a DOM object.
      Your message has been successfully submitted and would be delivered to recipients shortly.