+ Reply to Thread
Results 1 to 9 of 9

Thread: Applet loads but is hidden in Firefox

  1. #1
    flyingt is offline x10Hosting Member flyingt is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    5

    Applet loads but is hidden in Firefox

    Ok, so I'm making a game to learn about PHP. The link is here; you can log in as a Guest. (http://flyingtiger.exofire.net/). I decided to use an applet to send GET data for modifying the game state. I'm sure this isn't the best way to do it, but I'm proficient with Java and right now I just want something that works.

    The problem I'm having is that the applet displays in IE and Chrome, but not in Firefox. In Firefox, it loads but is hidden. I know the applet loads in Firefox because when I set View->Page Style to No Style the applet is visible. When style sheets are on, however, the applet is hidden. It is supposed to be inside the bright green box on the left hand side. Any help would be appreciated. Thank you.
    Last edited by flyingt; 12-31-2009 at 03:41 PM.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by flyingt View Post
    I decided to use an applet to send GET data for modifying the game state. I'm sure this isn't the best way to do it, but I'm proficient with Java and right now I just want something that works.
    The standard way is to use AJAX, but a Java applet will work fine.

    If you want to try AJAX, I say go for it. Javascript is simpler than Java, so don't worry about learning a new language. It's still quite elegant, despite (because of?) its simplicity. The only thing that might seem odd is JS's prototype-based inheritance ([2], [3]).

    Quote Originally Posted by flyingt View Post
    The problem I'm having is that the applet displays in IE and Chrome, but not in Firefox. In Firefox, it loads but is hidden. I know the applet loads in Firefox because when I set View->Page Style to No Style the applet is visible. When style sheets are on, however, the applet is hidden. It is supposed to be inside the bright green box on the left hand side. Any help would be appreciated. Thank you.
    I'm still trying to hunt down the exact cause, but the styling that's producing the effect is the "overflow: auto" on the game div. (Aside: use an external rather than inline stylesheet.) The simplest solution is to make the side-panel use fixed positioning, which (given that you've given it fixed position in all but styling) makes the most sense.

    On the topic of positioning, why do you have overflow hidden on <body> while the game div has fixed positioning and overflow of "auto"? Seems unnecessarily complex.
    Last edited by misson; 12-31-2009 at 07:42 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    flyingt is offline x10Hosting Member flyingt is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    5

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by misson View Post
    The standard way is to use AJAX, but a Java applet will work fine.

    If you want to try AJAX, I say go for it. Javascript is simpler than Java, so don't worry about learning a new language. It's still quite elegant, despite (because of?) its simplicity. The only thing that might seem odd is JS's prototype-based inheritance ([2], [3]).
    I'll look into this. I've been meaning to learn AJAX or JQuery, so I will after I've done more with the page.


    Quote Originally Posted by misson View Post
    I'm still trying to hunt down the exact cause, but the styling that's producing the effect is the "overflow: auto" on the game div.
    How is this possible? The applet isn't in the game div.


    Quote Originally Posted by misson View Post
    (Aside: use an external rather than inline stylesheet.) The simplest solution is to make the side-panel use fixed positioning, which (given that you've given it fixed position in all but styling) makes the most sense.
    A very good idea. I don't know why I didn't think of that. Thanks.

    Quote Originally Posted by misson View Post
    On the topic of positioning, why do you have overflow hidden on <body> while the game div has fixed positioning and overflow of "auto"? Seems unnecessarily complex.
    It is this way because when overflow wasn't set to auto, Firefox displayed two scrollbars on the right hand side. I'm sure making your suggested fix with the sidebar will help clean-up the webpage.

    Thanks for your time and consideration. I probably will learn AJAX soon, but if you have any more ideas about making the applet display, I'd be glad to know for future reference.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by flyingt View Post
    Quote Originally Posted by misson View Post
    I'm still trying to hunt down the exact cause, but the styling that's producing the effect is the "overflow: auto" on the game div.
    How is this possible? The applet isn't in the game div.
    That's what's so curious. I suspect a browser bug.


    Quote Originally Posted by flyingt View Post
    It is this way because when overflow wasn't set to auto, Firefox displayed two scrollbars on the right hand side.
    I meant why the whole set-up. If the game div didn't have fixed positioning, you wouldn't have two scroll-bars, hence no need to set overflow on <body> to hidden. You could simply rely on <body>'s scrollbars.


    Quote Originally Posted by flyingt View Post
    if you have any more ideas about making the applet display, I'd be glad to know for future reference.
    Setting the sidebar to fixed positioning is the fix; in addition to being a better style implementation, it causes the applet to display.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  5. #5
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: Applet loads but is hidden in Firefox

    I have a problem with your problem. The problem is, I don't have the problem!
    Using Firefox 3.5.6 on Ubuntu 9.10, the applet displays just fine.
    That makes it obvious it's a browser bug, and specific to your version or operating system.
    If I were you I'd file a bug report with Mozilla, in order to get it fixed in a future version. The link is https://bugzilla.mozilla.org/enter_bug.cgi, and don't forget to mention the problem doesn't exist on my configuration, it might help them trace the bug faster

    Edit: and make sure your Firefox is fully updated!
    Last edited by marshian; 01-01-2010 at 08:18 AM.

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by marshian View Post
    Using Firefox 3.5.6 on Ubuntu 9.10, the applet displays just fine.
    Flyingt already changed the positioning, so the display problem is gone. What happens if you change the positioning of the sidebar div (body > :nth-child(2)) to "absolute" using Firebug?

    Quote Originally Posted by marshian View Post
    That makes it obvious it's a browser bug, and specific to your version or operating system.
    Thanks for reminding me. I forgot to report I tested on FF 3.5.6/Vista. Flyingt, what are your browser and OS versions?
    Last edited by misson; 01-01-2010 at 05:37 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  7. #7
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by misson View Post
    Flyingt already changed the positioning, so the display problem is gone. What happens if you change the positioning of the sidebar div (body > :nth-child(2)) to "absolute" using Firebug?
    Ooh, I didn't realise he already fixed it x)
    Adding
    Code:
    body :nth-child(2) {
     position: absolute;
    }
    Moved a couple of elements, causing a few graphical glitches to appear in the game area, but the applet remains visible at all times.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  8. #8
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by marshian View Post
    Adding
    Code:
    body :nth-child(2) {
     position: absolute;
    }
    Moved a couple of elements, causing a few graphical glitches to appear in the game area, but the applet remains visible at all times.
    Sorry, I had the wrong element (should have looked at the source first; the 2nd child is a <br/>). The sidebar is body :nth-child(4). Note you'll have to add the style inline, otherwise the current inline style will override your changes.

    Edit: nevermind about checking. The page style has changed too much to re-introduce the original bug.
    Last edited by misson; 01-02-2010 at 12:37 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  9. #9
    flyingt is offline x10Hosting Member flyingt is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    5

    Re: Applet loads but is hidden in Firefox

    Quote Originally Posted by misson View Post
    Thanks for reminding me. I forgot to report I tested on FF 3.5.6/Vista. Flyingt, what are your browser and OS versions?
    I have Windows 7 and Firefox 3.5.6

    Thanks to both of you for your prompt and useful feedback.

    Quote Originally Posted by marshian View Post
    Moved a couple of elements, causing a few graphical glitches to appear in the game area, but the applet remains visible at all times.
    There are definitely a lot of things that need work. With only two people working on it, it can take a long time to fix any one thing.

+ Reply to Thread

Similar Threads

  1. Is Safari better then all other browsers?
    By javajenius in forum Crossfire
    Replies: 70
    Last Post: 06-22-2009, 10:30 AM
  2. What is the best internet browser?
    By callumacrae in forum Computers & Technology
    Replies: 53
    Last Post: 04-02-2008, 06:31 AM
  3. Which Web browser???
    By bilal855 in forum Off Topic
    Replies: 47
    Last Post: 03-23-2008, 10:39 PM
  4. FireFox 1.5 Final is Out
    By n4tec in forum Scripts & 3rd Party Apps
    Replies: 10
    Last Post: 12-02-2005, 11:58 AM
  5. 'Extremely Critical' Bugs Found In Firefox
    By stealth_thunder in forum Scripts & 3rd Party Apps
    Replies: 14
    Last Post: 05-15-2005, 02:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers