Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Dom

  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dom

    Am I correct that DOM is just a specific way of using html, css and javascript together?

    Can I use the three languages together in a way that would not qualify as DOM?

    /Mz

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    The DOM (Document Object Model) is, as best as I can explain it, just a way of breaking down a HTML page into objects that Javascript and CSS can get to. It's like an API for webpages. So to answer your questions, broadly speaking: Yes, and No.

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, I would say it in this way:
    - We have a document coded in HTML/XML/XHTML.
    - Said document contains or links in a part, the style sheet that is written using CSS or other style sheet languages.
    - We also have a script that executes code, in VBScript, JavaScript or any other DOM enabled language jacked into the browser.

    HTML provides the way to attach a style sheet or a script, as well as provides events that trigger script execution not associated with script loading. However, the script has no way of interacting with the document or the style sheet natively - it needs an API to do that. And that's where the DOM comes in. It provides the script access to the document and through it the style sheet, allowing the script to affect the document, which it would not be able to do otherwise.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DOM is not just for dynamic HTML and CSS - DOM is a model for traversing any XML document. SVG, for example, also has a DOM and uses DOM methods for scripting.
    Last edited by brothercake; 05-24-2004 at 08:54 PM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ooh, you speak so fine language, mazzas.

    Can you explain things a little more basically, please?

    Me don't know what API means or SVG and the like...

    Thanks, it's all very interesting.
    Mz

  • #6
    Rex
    Rex is offline
    New Coder
    Join Date
    May 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello Mzungu -

    API = Application Programming Interface

    It is something that executable programs use to do OS (Operating System) specific functions, like creating windows and dialogs, creating dialog elements (such as edits, combo boxes, buttons etc.), and so on. If I remember correctly, there are thousands of API functions and constants in Windows; they are stored categorized in multiple DLL files (Dynamic Link Libraries) such as kernel32.dll, user32.dll, gdi32.dll, and many more. Those are all located in your SYSTEM folder on Windows... they belong to the Windows core.

    Spudhead compared DOM functions to APIs.

    SVG = Scalable Vector Graphics

    - Rex
    Sincerely,
    Rex

  • #7
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, technically. The DOM is not just similar to an API, it IS an API. The DOM can be said to be a library of functions that allows an application access to modify the Document Infoset stored in memory. (The Document Infoset is the technical name for the memory structure that represents the document in the browser.)
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #8
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm reading this book primarily on javascript that also explains some things about dom and things are really starting to fall into place now. I think this is somewhat similar to what Neo experienced...

    [Forgot that it would be extremely appropriate if I use one of these: ]


  •  

    Posting Permissions

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