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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer window.location.href fails in Firefox

    this page in firefox get me a blank page.
    please help me!

    Code:
    <html>
    	<head>
    		<link rel="shortcut icon" href="icono.ico">
    		<script language="JavaScript1.2">
    			function ScreenGoToURL(Big,Medium)
    			{
    				var screen_height = screen.height;
    				var screen_width = screen.width;
    				var buffer = (document.all || document.layers ||documentGetElementByID) ? 30 : 48;
    				if (screen_height >= 768)
    				{
    					screen_width = 1024;
    					screen_height = 768;
    					var window_width = 1024-12;
    					var window_height = 768-buffer;
    					var window_top = 0;
    					var window_left = 0;
    					window.location.href(Big);
    					//window.open(Big,'','resizable=no,status=yes,width= ' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
    				}
    				else
    				{
    					screen_width = 800;
    					screen_height = 600;
    					var window_width = 800-12;
    					var window_height = 600-buffer;
    					var window_top = 0;
    					var window_left = 0;
    					window.location.href(Medium);
    					//window.open(Medium,'','resizable=no,status=yes,wid th=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
    				}
    			}
    		</script>
    	</head>
    	<body onload="ScreenGoToURL('index_1024x768.html','index_800x600.html')">
    	</body>
    </html>

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    Try:
    window.location.href=Big;
    window.location.href=Medium;

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nothing...

    in IE the page go!
    the problem is on the firefox.

    any idea?

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The problem isn't firefox. Its your poorly written code. This is wrong
    Code:
    documentGetElementByID
    It should be
    Code:
    document.getElementById
    You really shouldn't use javascript to give a user a page based on their resolution. Not everyone maximizes their browser window and not everyone has javascript enabled. I don't. If you taught yourself to code the proper way you wouldn't need javascript to redirect the user to a certain page. You would be able to make your layout resize accordingly to any resolution.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank u 4 all!
    you solved my problem!

  • #6
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macintosh

    on mac the page don't work.
    anyone know why?


  •  

    Posting Permissions

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