Welcome visitor
* Login
* Register
It is currently January 24th, 2019, 10:35 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » JavaScript



Post new topic Reply to topic  [ 3 posts ] 
Author Message
  random titles
PostPosted: July 6th, 2009, 8:16 pm 
User avatar

Posts: 27
hey, the other day i was on a site that each time you entered it has a different title though you were visiting the same address. i think they are using some kind of server side code for this changes, but do you know how to do it with javascript?


Top
 Profile  
 
  Re: random titles
PostPosted: July 6th, 2009, 9:37 pm 
User avatar

Posts: 137
<script type="text/javascript">     
//<![CDATA[

var t=new Array();
t[1]="title 1";
t[2]="title 2";
t[3]="title 3";
t[4]="title 4";

var nt=parseInt(4*Math.random()+1);

function changetitle() {document.title=t[nt];}

//]]>
</script>
</head>

<body onload="changetitle();">


Top
 Profile  
 
  Re: random titles
PostPosted: July 6th, 2009, 9:38 pm 
User avatar

Posts: 27
IT WORKS GREAT!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

FORUMS » Client Side » JavaScript


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron