Results 1 to 3 of 3

Thread: Ie Dom

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    I live here
    Posts
    14

    Ie Dom

    Does anyone know where i could find the [official if possible] downloadable reference to the Javascript Document Object Model of Internet Explorer. I cannot seem to find any reference for the DOM on msdn.com.

    Thanx.
    *I tried my best and falied miserably, the lesson... Never try.* - Homer J

  2. #2
    Lively Member Base's Avatar
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    65
    This is some info I found in an Jscript help, hope you can use it.

    Displaying Information In the Browser

    Microsoft JScript provides two ways to display data directly in your browser. You can use the write( ) and writeln( ), which are methods of the document object. You can also display information in forms within the browser, and in alert, prompt, and confirm message boxes.
    Using document.write( ) and document.writeln( )
    The most common way to display information is the write( ) method of the document object. It takes one argument, a string, which it displays in the browser. The string can be either plain text or HTML.
    Strings can be enclosed in either single or double quotation marks. This lets you quote something that contains quote marks or apostrophes.

    document.write("Pi is approximately equal to " + Math.PI);
    document.write( );


    --------------------------------------------------------------------------------

    Tip The following simple function is a way around having to type "document.write" every time you want something to appear in the browser window. This function does not inform you if something that you attempt to write is undefined, but does let you issue the command "w();", which displays a blank line.
    function w(m) { // Write function.
    m = "" + m + ""; // Make sure that the m variable is a string.
    if ("undefined" != m) { // Test for empty write or other undefined item.
    document.write(m);
    }
    document.write("<br>");
    }

    w('<IMG SRC="horse.gif">');
    w();
    w("This is an engraving of a horse.");
    w();




    --------------------------------------------------------------------------------



    The writeln( ) method is almost identical to the write( ) method, except that it appends a newline character to whatever string you provide. In HTML this ordinarily results only in a space after your item; but if you're using <PRE> and <XMP> tags, the newline character is interpreted literally and the browser displays it.

    When you call the write( ) method, it opens and clears the document if the document is not in the process of being opened and parsed when the write( ) method is called, so it can be dangerous. The example shows a script that is intended to display the time once a minute, but fails to do so after the first time because it clears itself in the process.

    <HTML>
    <HEAD>
    <SCRIPT LANGUAGE="JScript">
    function singOut() {
    var theMoment = new Date();
    var theHour = theMoment.getHours();
    var theMinute = theMoment.getMinutes();
    var theDisplacement = (theMoment.getTimezoneOffset() / 60);
    theHour -= theDisplacement;
    if (theHour > 23) {
    theHour -= 24
    }
    document.write(theHour + " hours, " + theMinute + " minutes, Coordinated Universal Time.");
    window.setTimeout("singOut();", 60000);
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <SCRIPT>
    singOut();
    </SCRIPT>
    </BODY>
    </HTML>

    If you use the alert() method of the window object instead of document.write(), the script works.
    window.alert(theHour + " hours, " + theMinute + " minutes, Coordinated Universal Time.");
    window.setTimeout("singOut();", 60000);
    }

    Clearing the Current Document
    The clear() method of the document object empties the current document. This method also clears your script (along with the rest of the document), so be very careful how and when you use it.
    document.clear();


    Hope it's readable.
    Good luck
    Ok

  3. #3
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    No good can come of this.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width