programers help me please

    The forums have been archived. Please read this thread for more information.

    • You need to do it separately where you have one HTML file and one Javascript file where you define the function and where you link the script.

      <script type="text/javascript" src="nameofyourjavascripthere"></script>

      At least that's if you wanna make a webpage out of it, but you don't even have a Doctype so I don't really know what you are doing.
      Besides, I haven't worked with Java per se, only made some functions for registering and logging in on sites with Javascript. Don't know if it matters.
      "I've begun my voyage in a paper boat without a bottom; I will fly to the moon in it."
      "When this paper aeroplane leaves the cliff edge, and carves parallel vapour trails in the dark, we will come together."
    • Not much makes me register on a board just to help someone randomly, but when you use the <font> tag I pretty much cannot resist wiping that atrocity of a tag from the face of the planet.

      Few things first:
      1.) Learn jQuery, it's basically a go-to with Javascript these days. Changing an image's source is literally:

      Source Code

      1. $("#img-id-here").src("http://your.url/image.jpg");


      2.) Use the <span> tag, the <font> tag is heresy and should be treated as such.

      Source Code

      1. <span style="color: red;"></span>


      3.) Instead of an if for each name, if they're all the same value, do this:

      Source Code

      1. if(name == "justin" || name == "brad" || name == "phoenix" || etc etc)


      The double pipe || means OR.

      I'm not going to do this for you albeit, you won't benefit from it otherwise.

      Oh, and on another note, Fred is right you can do it via two files, but it's unnecessary for something so little.