Curse you W3! You broke my script.

Discussion in 'Programming' started by fireflyproject, Aug 14, 2008.

  1. #1
    Right. So I have been testing a small piece of code in a basic HTML format without thinking about putting a W3 tag up top... then I did, and it broke!

    So. Help me debug this please.

    Here is my function (javascript)
    function show_confirm(className) {
    	var screen_width = document.body.clientWidth - 300;
    
    	document.getElementById("alert-box").styleName = className;
    	document.getElementById("alert-box").style.display = "block";
    	document.getElementById("alert-box").style.left = screen_width / 2 + "px";
    }
    Code (markup):
    Very simple, eh?

    Here is the CSS to go along with it.

    #alert-box {
    	position:fixed;
    	_position:absolute;
    	top:200;
    	_top:expression(eval(document.body.scrollTop)+200);
    }
    Code (markup):
    So, I know that _property doesn't validate... but that shouldn't force everything to go down the drain... at least in my experience I haven't seen it before. Which brings me to "I'm not sure why it broke it."

    If you have any advice, rep will be given.

    Thanks!!!

    P.S. When I remove the _properties it still doesn't work.
     
    fireflyproject, Aug 14, 2008 IP
  2. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #2
    Nevermind.... I think I found the issue.
     
    fireflyproject, Aug 14, 2008 IP