#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    5
    Rep Power
    0

    Javascript Game..


    Hi. Degsy told me to come here.

    ok, first here's the link to what i have so far...
    http://www.rpgwizard.com/Pages/cfcdemo4.htm

    Alright, now in the box that says... "It's Alex vs. Dns right now. All they can do is attack." I eventually want some other choices to pop up. When it's Alex's turn, and he hits "Attack", I want 3 links to pop up, each with the name of someone on the other team. Then, if you click the link, it does the equation to attack that person.

    Also, if you hit "Magic", then 2 different links pop up, for different magic attacks, that only Alex can perform. I'm also, later on, going to make it so you can choose your player in the beginning of the game, so all these links have to be versatile.

    Now, I know how to code the actual functions, that do all the work. My question is... how do I make the above mentioned links show up on the screen, only when needed, and then erase again? I tried using
    ------------------------------------------------------------------
    va*r msg = "(Place link here)";
    va*r td = document.*getElementById("*test");
    td.f*irstChild.n*odeValue = "msg";
    -----------------------------------------------------------------

    but all that does, is place the words < a href > into that "test" table division, instead of making an actual link.

    I also thought of having hidden layers that pop up, but with all the characters that I'm eventually going to have, the amount of layers would be enormous. Plus, I'd want everyone, and not just IE 4.0+ users to play.

    I hope I explained myself properly. Please help me, if you can.
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    24
    document.getElementById('whatever').innerHTML = '<a href...'

    will put an actual link inside a document element.

    Any help??
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    5
    Rep Power
    0
    I LOVE YOU!!

    I've been stewing over this prob. for 2 days, and all I needed was to put innerhtml. Thank you so much!!
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    5
    Rep Power
    0
    Edit: All problems solved. Thank you so much, Binky, for your help.
    Last edited by GlacierMage; October 11th, 2002 at 08:36 PM.

IMN logo majestic logo threadwatch logo seochat tools logo