2 replies [Last post]
georgeadams
georgeadams's picture
Offline
newbie
London
Last seen: 8 years 29 weeks ago
London
Joined: 2013-10-20
Posts: 3
Points: 5

Hi all

I've built this VERY basic website

http://www.georgeadams.eu

I'd like the title of the page to change every time you go on it to be a different anagram of my name.
How would I go about doing this?

I've attached the very basic code I wrote for the page in text edit.

Any help would be much appreciated.

Thanks
George

---------------

body {
font-family: 'Oswald', serif;
font-size: 90px;
color: #FFFF00;
line-height:97%;
letter-spacing:-2px;
}

Dares Mega Go

GEORGE ADAMS

+[0]7900 814 861GRAPHIC DESIGNCREATIVE DIRECTION

georgeadams
georgeadams's picture
Offline
newbie
London
Last seen: 8 years 29 weeks ago
London
Joined: 2013-10-20
Posts: 3
Points: 5

<html> <head> <link

<html>
  <head>
    <link href='http://fonts.googleapis.com/css?family=Oswald:700' rel='stylesheet' type='text/css'>
    <style>
      body {
        font-family: 'Oswald', serif;
        font-size: 90px;
	color: #FFFF00;
	line-height:97%;
	letter-spacing:-2px;
      }
    </style>
<title>Dares Mega Go</title>
  </head>
  <body>
    <div>GEORGE ADAMS<br>
HELLO@GEORGEADAMS.EU<br>+[0]7900 814 861<br>GRAPHIC DESIGN<br>CREATIVE DIRECTION<br>
<a href="mailto:[email protected]"
 
style="color:#FFFF00; text-decoration: none">&#9993;</a>
</div>
  </body>
</html>

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 2 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi George, You would need to

Hi George,
You would need to use JavaScript to do this.

 
<script type="text/javascript">
    var shuffle = function (x) {
    var a = x.split(""),
        n = a.length;
 
    for(var i = n - 1; i > 0; i--) {
        var j = Math.floor(Math.random() * (i + 1));
        var tmp = a[i];
        a[i] = a[j];
        a[j] = tmp;
    }
    return a.join("");
  }
    window.onload = function(){
      var title = document.title;
      var ana = shuffle(title);
      document.title = ana;
    };  
    </script>

http://stackoverflow.com/a/3943985