Results 1 to 5 of 5

Thread: doctype problem in firefox

  1. #1
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default doctype problem in firefox

    http://www.alexis-html.com/test.html

    it works perfect in IE7 but not in FF3
    if i change the doctype to:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    then it works in firefox but in IE all my design falls apart
    it has to be in
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    so what do i have to fix to the code so it works with xhtml1-transitional doctype in both browsers???
    Last edited by Snookerman; 05-20-2009 at 07:31 AM. Reason: added [html] tags and “Resolved” prefix

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    First, you need to change highlighted with: type="text/javascript" as it's deprecated:
    Code:
    <script language="JavaScript">
    The problem is not on the doctype, but on your script.

    You need not to use "eval()" if you want to get the element's ID prefixed with TR and the passed argument.

    You can always use "document.getElementById()" and concatenate "tr" with the passed argument.

    Migh help:
    Code:
    function disp1(id) {
    	var ObjDisplay = document.getElementById("tr"+id);
    	for (i=1;i<5;i++) {
    		document.getElementById("tr"+i).style.display="none";
    	}	
    	ObjDisplay.style.display="block";
    }
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default

    it still doesnt work in firefox
    Code:
    <script language="JavaScript">
    		function disp1(id) {
    	var ObjDisplay = document.getElementById("tr"+id);
    	for (i=1;i<5;i++) {
    		document.getElementById("tr"+i).style.display="none";
    	}	
    	ObjDisplay.style.display="block";
    }
    	</script>
    Last edited by Snookerman; 05-20-2009 at 07:11 AM. Reason: added [code] tags

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    It works fine on my end, please script the code on your live URL.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #5
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default

    oops sorry
    thank you so much for your help!!

Tags for this Thread

Bookmarks

Posting Permissions

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