random text on login/refresh

Discussion in 'Software' started by geekinthemaking, May 29, 2006.

  1. geekinthemaking

    geekinthemaking Private E-2

    Ok this is probably a really dumb question but anyway (I'm still learning...) - notice on the Major Geeks homepage, everytime you enter the site or refresh the page it shows a different slogan on the top?

    Will someone please care to explain to me how this works - like what is this function called and what code is probably being used here and the principle behind it? I'm not asking for the code - that I can figure out eventually but please at least point me in the right direction here?
     
  2. Kodo

    Kodo SNATCHSQUATCH

    you have a bunch of quotes. say 10.
    You make an array and add the quotes (as a string) to the array.
    arrays are indexed 0 to n

    so you make a function that randomly accesses an index of the array and writes it out to the browser.
     
  3. geekinthemaking

    geekinthemaking Private E-2

    Hi Kodo

    Thanks - you make it sound so easy although I'll probably spend hours making it work anyway - but at least now I know where to start...
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds