Advanced Search

Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Java Applet

  1. #21
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    27,641
    Thanks
    42
    Thanked 2,897 Times in 2,869 Posts
    Blog Entries
    12

    Default

    This looks like a good solution (tested in Opera, IE, Google Chrome, Safari Win, Firefox):

    You can actually make this an external script, save in a plain text editor as appdelay.js:

    Code:
    (function(){
     if (window.opera) {
      var applet = document.getElementById('app').innerHTML;
      document.getElementById('app').innerHTML = '';
     }
     else
      var applet = document.getElementById('app').removeChild(document.getElementById('theapp'));
     var doApplet = function(){
      if (window.opera)
        setTimeout(function(){document.getElementById('app').innerHTML = applet;}, 0);
      else
        setTimeout(function(){document.getElementById('app').appendChild(applet);}, 0);
     };
     if (window.addEventListener)
      window.addEventListener('load', doApplet, false);
     else if (window.attachEvent)
      window.attachEvent('onload', doApplet);
    })();
    Next, surround your applet code, and anything else associated with it whose appearance you want to be delayed with these two div elements (the id's are important), and follow that with the script call, ex:

    Code:
    <div id="app"><div id="theapp"><APPLET NAME='DigiChat' CODEBASE='http://67.19.116.210/DigiChat/DigiClasses/'
    CODE='com.diginet.digichat.client.DigiChatApplet'
    HEIGHT=85 WIDTH=210 ALIGN='MIDDLE'
    ARCHIVE=Client_5_1_0_7.jar MAYSCRIPT>
    <PARAM NAME=cabbase value=Client_5_1_0_7.cab>
    <PARAM NAME=siteID VALUE=253220019>
    
    <param name="room" value="ThE ChAtPiT">
    <PARAM NAME=MenuItem1 VALUE=Zubee! Online>
    <PARAM NAME=MenuLocation1 VALUE=http://www.zubee.com>
    <PARAM NAME=KickUserHTML VALUE='http://www.chatpit.com/chatrooms.html'>
    <PARAM NAME=helpURL VALUE='http://www.zubee.com/'>
    <param name="background" value="396B9C">
    <param name="textcolor" value="FFFFFF">DigiChat free teen chat rooms require a Java Compatible web browser to view our free teen chat rooms.&nbsp; World Chat Teen Chat Teen Talk
     Afghanistan
     Albania
     Algeria
     Andorr . . . 
     . . . New Zealand 
    Message Boards
    &nbsp;
    </applet>
    <!-- *** END APPLET CODE *** -->
    
    <font color="#FFFFFF"><font face="Comic Sans MS"><font size=-3><b>Teen chatters under the age of 18 are advised to get parental permission before entering our teen chat.</b></font></font></font>
    </div>
    </div><script src="appdelay.js" type="text/javascript"></script></td>
    Make sure that the appdelay.js file is in the same folder as the page.

    BTW, as far as I know, all of this stuff:

    Code:
     Afghanistan
     Albania
     Algeria
     Andorr . . . 
     . . . New Zealand 
    Message Boards
    &nbsp;
    Is just text to be displayed in the event that the browser cannot render the applet. Is all that really necessary, or does it also have some other purpose that I'm unaware of?

    If you want to pay me, send me an email by going to:

    http://www.dynamicdrive.com/forums/member.php?u=2033

    click on Contact Info and then on:

    Send a message via email to jscheuer1

    use the address it shows, or just take that address to PayPal.com and send money to me using it as the recipient.

    P.S. 50 dollars is fine by me.
    Last edited by jscheuer1; 01-24-2009 at 05:52 PM. Reason: add P.S.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Rick777 (01-25-2009)

  3. #22
    Join Date
    Jan 2009
    Posts
    25
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Smile

    http://www.chatpit.com/teenchat/
    http://www.chatpit.com/index.htm
    Thanks guys, I have added the code to both pages.
    I hope I got it right.
    Rick

  4. #23
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    27,641
    Thanks
    42
    Thanked 2,897 Times in 2,869 Posts
    Blog Entries
    12

    Default

    I would like to clarify. We're doing all of this in the first place in order to delay the appearance of the chat applet until after the page loads, right? If I've got the concept wrong, then just what is it? Anyways, if this is the idea, if during any particular load of either of these pages the page takes longer than usual to load, this will mean that it will take longer than usual for the applet to show up, that's part and parcel of what we've done.

    Also your pages are inefficiently coded and invalid (scary word, it just means that they don't precisely follow coding standards, instead relying upon error correction and quirks in browsers). I just thought you should know that, but it doesn't really impact much what we are doing with this particular thing.

    The only serious problems in that regard (really the only serious problems at all) I see are that you removed one of the closing </div> tags on both pages. On http://www.chatpit.com/teenchat/ that would be here:

    Code:
     . . . lor_text = "CCCCCC";
    google_color_url = "999999";
    //-->
    
    </script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    
    </div></div><script src="appdelay.js" type="text/javascript"></script></td>
    On http://www.chatpit.com/index.htm it would be here:

    Code:
     . . . h Africa
    Tanzania 
    Tunisia 
    Zimbabwe 
    Australia 
    Fiji 
    New Zealand 
    Message Boards
    </applet><!-- *** END APPLET CODE *** -->
    </div></div><script src="appdelay.js" type="text/javascript"></script><font color="#FFFFFF"><font face="Comic Sans MS"><font size=-3><b>Teen chatters under the age of 18 are advised to get parental permission before entering our teen chat.</b></font></font></font></td>
                              </tr>
                            </table>
    Most browsers will error correct for that, but in IE it is quite possible that the browser will hang, unable to complete the loading of the page. This in fact happens on the http://www.chatpit.com/teenchat/ page. So put both of those back in.

    Now, (also on that page) it's a bit risky to inclucde the Google ad scripts in the area that is removed and reinserted, but it appears to work out OK. And I would think that on the other page you might want to include:

    Code:
    <font color="#FFFFFF"><font face="Comic Sans MS"><font size=-3><b>Teen chatters under the age of 18 are advised to get parental permission before entering our teen chat.</b></font></font></font>
    in the section that is being delayed, but that's just a judgement call.

    Either way, you may want to set the height of that table:

    Code:
                            <table border width="210" height="125" bgcolor="#396B9C" >
                              <tr> 
                                <td><center>
    <!-- *** START APPLET CODE *** --><center><div id="app"><div id="theapp"><APPLET NAME='DigiChat' CODEBASE='http://67.19.116.210/DigiChat/DigiClasses/'
    CODE='com.diginet.d
    to 125 as shown, so that it will already be near to its intended size once the app does arrive. Again, just a judgement call.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Rick777 (01-25-2009)

  6. #24
    Join Date
    Jan 2009
    Posts
    25
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thank you again.
    I have very little knowledge of html. Some of the pages started with Navigator Gold, and Communicator. </div>

    I added that back in as I thought it was extra at first, as the page worked.
    I took your suggestion for the table.

    I was worried about the google code where it was to, but so far no complaints from them. The solution I had for that was a table for the ad code and the applet made on NVU, but that moved over the ad code to where I wanted it when the applet loaded. I figured google would frown on that. I still have my fingers crossed with this one. The page no longer hangs waiting for the applet to load. We are very happy. I am not the best person to improve our pages. Always looking for solutions, but we do not have much right now to improve our pages.
    This is a great site. You guys have both been very helpful.
    Rick

  7. #25
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    27,641
    Thanks
    42
    Thanked 2,897 Times in 2,869 Posts
    Blog Entries
    12

    Default

    It's actually a bit funny what happens with the Google ad code. It must be that the Google scripts create their little ad element that they populate remotely anyway. Then our script takes away the element and puts it back. It also takes away the Google scripts and puts them back, but since scripts added after page load don't run, it harms nothing.

    On the two </div> tags, it's just a matter of we opened to div's:

    Code:
    <div id="app"><div id="theapp"><APPLET NAM . . .
    in front of the applet, so we must close them both afterward.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Rick777 (01-26-2009)

  9. #26
    Join Date
    Jan 2009
    Posts
    25
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks you for the help, it helps me to undersand some more about codes for pages.
    This looks to be best pace for coding help.
    Rick

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
  •