Results 1 to 10 of 10

Thread: (Javascript) Object doesn't support this property or method? **Resolved**

  1. #1

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    (Javascript) Object doesn't support this property or method? **Resolved**

    What is wrong with this line? I am getting the error "Object doesn't support this property or method"

    Code:
    document.getElementByID('propertyinvoiceDivHead').scrollLeft=document.getElementByID('propertyinvoiceDivBody').scrollLeft;
    thanks
    Michael
    Last edited by msimmons; Oct 16th, 2002 at 04:13 PM.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  2. #2

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    ok here is my working function but is it proper?
    Code:
    function f_doScroll($1,$2){
    	oDivHead=document.all($2);
    	oDivBody=document.all($1);
    	oDivHead.scrollLeft=oDivBody.scrollLeft;
    }
    thx
    ms
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  3. #3
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    document.all isn't in the standard DOM, it's an IE only feature. What exactly are you trying to do?
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444

    Re: (Javascript) Object doesn't support this property or method?

    Originally posted by msimmons
    Code:
    document.getElementByID('propertyinvoiceDivHead').scrollLeft=document.getElementByID('propertyinvoiceDivBody').scrollLeft;
    I think you should lower case the d in ID, that may be the cause.

  5. #5
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    i didn't see that, well done. Yeah, it won't work unless it's getElementById
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  6. #6

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    And I always do that too... (the ID rather than Id). What I am doing is I have tabular data that needs a 'sticky' header row so I am doing it w/two div's w/tables in them so if the data gets too wide and the botom (data) scrolls left to right then the top (headers) will scroll simutaniously.
    Thanks guys (you two are the HTML/Javascript gurus )
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  7. #7
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I made that mistake when I first learnt about getElementById too, so I would spot it And as you said earlier all should be getElementById in the other function too to be cross-browser.

  8. #8

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Yeah, I'll be changing it back cos like I said in that other post (yesterday i think?) that I am trying to code to standards now.
    ms
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  9. #9
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Originally posted by msimmons
    Thanks guys (you two are the HTML/Javascript gurus )
    Michael
    Girly voice: Oh stop that you, you're making me blush There are plenty of other people here that are great with HTML too, we're just sad enough to read all the posts

  10. #10

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    yeah, you two just seem to always be the ones to answer... I haven't seen CiberTHuG in a long time.
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

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