The >>Official<< HTML/Javascript Thread

Discussion in 'Fan Sites' started by Smuggler-of-Mos-Espa, Dec 5, 2002.

Thread Status:
Not open for further replies.
  1. Kadue Jedi Grand Master

    Member Since:
    Jun 20, 2000
    star 5
    yodaminch, it's because both your "then" and "now" dates are exactly the same.

    Say the date you're counting down to is May 15, 2005, do this.

    Change: var then = new Date();

    to: var then = new Date(May 15, 2005);
  2. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
    I tried that and it didn't work. I inserted that though. What else do i need?

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var now = new Date(January 22, 2003);
    var then = new Date(May 15, 2005);
    var gap = then.getTime() - now.getTime();


    dleft = Math.floor(gap / (1000 * 60 * 60 * 24));

    hleft = Math.floor((gap/(1000*60*60))-(dleft *24));

    document.write("Only " + dleft + " days " + hleft + " hours \'till 11:59 p.m.,);

    //-->
    </SCRIPT>
  3. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
    Okay I finally got it to work
    To add an html for a countdown to episode 3
    enter this code:

    <br>
    <script language="javascript" type="text/javascript">
    <!--
    var date = new Date('May 15, 2005');
    var now = new Date();
    var diff = date.getTime() - now.getTime();
    var days = Math.floor(diff / (1000 * 60 * 60 * 24));
    document.write("<b><font color=\"white\">" + (days + 1) + " days until Star Wars Episode 3</b></font>" );
    //-->
    </script>
    <br>
  4. AERYN_SUN Jedi Grand Master

    Member Since:
    Apr 1, 2001
    star 5
    i want to add an image map to my new site, and i know it can be done in dreamweaver but where do i go to get it started?
  5. Valiowk Force Ghost

    Member Since:
    Apr 23, 2000
    star 6
    Does anybody here know of a website that can check HTML coding to ensure that there are no errors in the code, and that they satisfy whatever type of HTML we used?

    Thanks in advance.
  6. Night4554 Jedi Grand Master

    Member Since:
    Oct 9, 2000
    star 5
  7. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
    okay i want to make an image link to a webpage. Is this an image map and what's the code?
    if its not an image map. what is it and whats the code?
  8. Aanix_Durray Jedi Master

    Member Since:
    Dec 29, 2001
    star 4
    It depends on whether you want a portion of the image to link to the wepage (which would be an image map), or the entire image to do so. With the former, it's slightly more complicated and would be difficult to explain thoroughly, however, this is the tutorial I've used on previous occasions. With the latter, you simply enclose the image code within the code for the link, thusly:

    <a href="boards.theforce.net"><img src="theforce.jpg"></a>



    Hope that helps :)

    -~Aanix~-
  9. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
  10. Lobot_Omy Moderator Emeritus

    Member Since:
    Jul 9, 2001
    star 6
    Also you can make separate JavaScript files with .js externsion and then include them in your page like this: <script language="JavaScript" src="yourjsfile.js"></script>

    This way you can include the same code in many pages and you wouldn't have to go through all of your html files if you'd decide to make a change in your JavaScript code. You'd just edit that one file and the change would be reflected across all page using this file. Also you can use it to hide code, kind of. But it's still possible to see the contents of the file.

    Also be weiry about using JavaScript in your links on these forums, there was a big broohaha about it a year ago.
  11. Night4554 Jedi Grand Master

    Member Since:
    Oct 9, 2000
    star 5
    Pretty much all of the fun ones got deactivated. But we still have alerts, confirms, and redundant linkage.

    :(
    :(
    :(

    [image=javascript:alert('See')]

    ¤Night
  12. Lobot_Omy Moderator Emeritus

    Member Since:
    Jul 9, 2001
    star 6
    Woah. Zerosleep took the action in his own hands there, didn't he. :) That's OK. JavaScript was widely abused on these boards anyway, by me as well :D .
  13. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
    Okay this might be hard to explain. I want to have several different banners on my site. I want it so that each time a person visits they can see a different banner. Does that make any sense if so what the code?
  14. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
    While I am at it how do i add thumnails?
    what's the code
  15. YodaJeff Manager Emeritus

    Member Since:
    Oct 18, 2001
    star 7
    For thumbnails, you have to re-size the images in an image editing program, or else they're useless. You could use <img src="whatever.jpg" height=100 width=100>, but unless whatever.jpg really is 100x100, it'll still take as long to load as the image by itself.

    As for the random rotating banners, I'm not positive, but there probably is a Perl script out there that could help.
  16. SobiFan Jedi Knight

    Member Since:
    May 7, 2003
    star 3
    For thumbnails, don't make the oh-so-common mistake of just doing <img src="image.jpg" height="20" width="50">. This is a HUGE no-no. It makes us poor modem users wait long, and it's a novice thing to do. To thumbnail pictures, you need to create thumbnails... I suggest getting a thumbnail program (try download.com, I use 'Easy Thumbnails'). Create the thumbnails and use them, instead of the original image. Eg; <a href="image.jpg"><img src="image_thumbnail.jpg">

    :D

    http://orbitcycle.com try that for the rotating banner things. I know a girl who does a banner exchange with it :) so it must work lol.
  17. Lobot_Omy Moderator Emeritus

    Member Since:
    Jul 9, 2001
    star 6
    You could do the rotating banner thing using any server-side scripting language. All you have to do is put all the banners in one directory have the script read the cookie it makes to see which banner to display next (if no cookie exists then make one and just return the 1st banner), read all of the banners files in that directory and return the one that the cookie says to return, and update the cookie as well. Or you could simply pick a banner at random.

    I did something similar using JavaScript, but because JavaScript is solely client-side I have to list all the banner filenames in an array inside the script.
  18. Yodaminch Force Ghost

    Member Since:
    Mar 6, 2002
    star 5
    Sobifan-Thanks both worked except the rotating hosts adds their banners in.
    Lobot Omy-I have no idea how to do any of that with freewebs.com. If you coould dumb it down a little i might understand
  19. AmberStarbright Jedi Grand Master

    Member Since:
    Dec 20, 2002
    star 7
    I have a question on java script. I have noticed on some websites that you are unable to right click on the page. If you do it comes up with a pop up box does anyone know how to do this? :)
  20. Lord_RJ Force Ghost

    Member Since:
    May 12, 2003
    star 4
    The method they use is not foolproof.....You can still go to view-->Source and get all of that info.......
  21. YodaJeff Manager Emeritus

    Member Since:
    Oct 18, 2001
    star 7
    Yeah, that usually works. Sometimes, you also can right-click while holding down the left mouse button, and the regular right-click menu thing will pop up that way.
  22. AmberStarbright Jedi Grand Master

    Member Since:
    Dec 20, 2002
    star 7
    I know I just want to put some people off from using my images because at the moment I am constantly having to change file names because they are linking them to a message board.
  23. AmberNotBright Jedi Youngling

    Member Since:
    May 22, 2003
  24. AmberStarbright Jedi Grand Master

    Member Since:
    Dec 20, 2002
    star 7
    Never mind I have managed to get a way to stop hotlinking my images
Thread Status:
Not open for further replies.