joemamahunt Posted April 30, 2007 Share Posted April 30, 2007 This may be the wrong board and not even made using JavaScript but.. On this website: http://littlegreenfootballs.com/weblog/ They have a random messege displaying in the <title>. When you View Source you find also a JavaScrip looking like this: <script language="Javascript" type="text/javascript"> <!-- var axel = Math.random() + ""; var ord = axel * 1000000000000000000; //--> </script> Which to me looks like the randomizer code. How can I do something similar to this on my own website? Quote Link to comment Share on other sites More sharing options...
fenway Posted April 30, 2007 Share Posted April 30, 2007 What do you think that this is doing? Where are these variables used? Quote Link to comment Share on other sites More sharing options...
joemamahunt Posted April 30, 2007 Author Share Posted April 30, 2007 My guess would be either from a MySQL database or a PHP page, however linked by a JavaScript code. But I don't know anymroe than you do of that website or the source. So I just want to know how I could do something similar to that, that would give me the same results. Quote Link to comment Share on other sites More sharing options...
fenway Posted April 30, 2007 Share Posted April 30, 2007 But I don't know anymroe than you do of that website or the source. So I just want to know how I could do something similar to that, that would give me the same results. Sure you do.. I haven't looked at it. Quote Link to comment Share on other sites More sharing options...
joemamahunt Posted April 30, 2007 Author Share Posted April 30, 2007 Well it's kind of hard to know what I'm talking about then isn't it.. The <title> in the <head> of the website, it changes on each visit/refresh. Can't explain it any better. :-\ Quote Link to comment Share on other sites More sharing options...
mainewoods Posted May 1, 2007 Share Posted May 1, 2007 that script doesn't seem to have anything to do with it. The easy way to do it is server side. Using php: <?php /* set $randomvariable here */ ?> <html> <head> <title><?php echo $randomvariable; ?></title> </head> Quote Link to comment Share on other sites More sharing options...
joemamahunt Posted May 1, 2007 Author Share Posted May 1, 2007 That would work? Hmm, I've tried similar things before and they didn't work, however tried it now and it works fine. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.