Results 1 to 4 of 4
  1. #1
    Dont is offline Member
    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Question Linking javascript to html, and using a timer for messages. Beginner.

    Hi everyone, I'm trying to use java and html for one purpose, gaming. I host a GMOD server, and the loading screen is what I am here for. The loading screen is HTML. I know a decent amount of html, that's not really what I am asking for help on, I don't know any java.

    My html.
    XML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><link type="text/css" rel="stylesheet" href="html resources/maincss.css">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>QUBE TTT</title>
    <script type="text/javascript" src="html resources/timedmessage.js"></script>
    </head>
    <body background="html resources/background1.jpg">
    <p>Welcome to the QUBE TTT Server! </p>
    <p>Please enjoy your stay, and read the rules! </p>
    <p>The download is about 15mbs, not much!</p>
    <p>It's a one time thing. You'll love this server! 
    </p>
    <b><div id="timedMsgDiv"></div></b>
    </body>
    </html>
    Java Code:
    function timedMsg() {
    	currMsg++;
    	document.getElementById('timedMsgDiv').innerHTML = msgArr[currMsg%msgArr.length];
    };
    
    function init() {
    	currMsg = -1;
    	msgArr = Array('Banning you from traitor.', 'Eating raw fetus remains', 'Trippin on balls', 'Uploading Dont and Coyotes porno', 'Allowing rd- GOTCHA', 'Breaking FastDL', 'Stealing your credit cards. >:3', 'Punching Garry on his tip. Think about it.', 'Praying to Winsis for forgiveness.', 'Crying because forgiveness wasnt given', 'Weening Dont off Mtn Dew, yea right.', 'Performing a colonoscopy on your mother', 'Mutating Coyote in an actual Coyote', 'Performin swag fag genocide', 'Fappin it', 'Winsis is love, winsis is life.', 'Remembering when music was, actually music', 'Begging based god for lessons');
    	timedMsg();
    	var t=setInterval("timedMsg()",2000);
    };
    
    window.onload = init();
    The only problem, is it's not working. I would expect this to display my (immature) messages inside of the div tag, but when loaded into Dreamweaver or chrome, it's nowhere to be found on screen.
    Thanks for any help!!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: Linking javascript to html, and using a timer for messages. Beginner.

    JavaScript is not Java. You need to find a JavaScript forum. This isn't one.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Dont is offline Member
    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Default Re: Linking javascript to html, and using a timer for messages. Beginner.

    Major facepalm. Thanks lol.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,236
    Rep Power
    19

    Default Re: Linking javascript to html, and using a timer for messages. Beginner.

    THREAD CLOSED

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. HTML/JavaScript
    By HarleyRowland in forum Forum Lobby
    Replies: 1
    Last Post: 02-13-2013, 08:14 PM
  2. Replies: 1
    Last Post: 01-02-2011, 07:23 PM
  3. Linking a servlet from HTMl
    By mallyjay in forum Java Servlet
    Replies: 4
    Last Post: 02-26-2009, 10:31 AM
  4. HTML linking and java applets
    By Bomber_Will in forum Java Applets
    Replies: 4
    Last Post: 02-08-2009, 07:50 PM
  5. beginner to create a countup timer
    By taishan in forum New To Java
    Replies: 3
    Last Post: 11-13-2008, 05:46 AM

Posting Permissions

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