Results 1 to 10 of 10

Thread: (javascript & css) Where is the syntax error?

  1. #1

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

    (javascript & css) Where is the syntax error?

    (I know I promised nver to post on friday before my 3rd cup of coffee but I'm stuck)

    I am getting a syntax error on this line
    Code:
    parent.frames[0].document.getElementById(DivDay).style.z-index = '-1';
    probably something silly.
    Thanks in advance,
    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.

  2. #2

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Just so no one is worried I found another way around it. Would still like to know where the error is though.
    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.

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Didn't you just forget to put quote marks around the DivDay bit?

  4. #4

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Sorry, should have given more info.
    Code:
    DivDay = 'cell1_7';
    parent.frames[0].document.getElementById(DivDay).style.background = '#cccccc';
    parent.frames[0].document.getElementById(DivDay).style.cursor = 'default';
    parent.frames[0].document.getElementById(DivDay).style.z-index = '-1';
    Good try though... Thats my error 99% of the time
    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.

  5. #5
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    Three questions:

    1) Have you tried putting double quotes around cell_7 instead of single?
    2) Why even have a variable?
    3) What browser are you testing this in?
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  6. #6

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    1) Have you tried putting double quotes around cell_7 instead of single?
    No, but the only line that is getting the error is the z-index one... the others work fine w/o it.

    2) Why even have a variable?
    Because I build that code via ASP and javascript was giving me problems doing it inside of the parens... plus I only have to build the asp part once this way.

    3) What browser are you testing this in?
    IE 5.5 but would like for it to be to standards. I am new to trying standards so if you see anything that is non-compliant let me know

    Thanks,
    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
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    ahh its zIndex not z-index
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  8. #8

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    hmmm... odd. Is it that way in the style sheet also? (because I am using z-index there and it is fine but that could be a fluke).

    Thanks!
    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.

  9. #9
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Code:
    parent.frames[0].document.getElementById(DivDay).style.z-index
    Theres you problem, its z-index if you are using css but if you are setting it with DHTML its actually just zIndex. Javascript doesn't like the - so its removed.

    Take a look here to see what I mean...

    http://msdn.microsoft.com/workshop/a...asp?frame=true
    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

  10. #10

    Thread Starter
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    OK, cool. Thanks a bunch guys.
    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.

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