Polak
I am cool.
- Reaction score
- 83
Is there a code that makes a URL Link on a website change to another URL after like 1 hour or so?
The URL never changes. It is always http://www.thehelper.net/
<meta http-equiv="refresh" content="3600;url=http://www.URL HERE.com">
Do it using a META refresher if you have no programming experience.
Code:<meta http-equiv="refresh" content="3600;url=http://www.URL HERE.com">
Place that within the <head> ... </head> tags in your source.
** WOOT 1000th post... only took 4 years... **
Do it using a META refresher if you have no programming experience.
Code:<meta http-equiv="refresh" content="3600;url=http://www.URL HERE.com">
Place that within the <head> ... </head> tags in your source.
** WOOT 1000th post... only took 4 years... **
How does that change the current URL to a new one?
<meta http-equiv="refresh" content="3600;url=http://www.URL HERE.com">
<meta http-equiv="refresh" content="60">
<meta http-equiv="refresh" content="60;url=URL HERE">
<meta http-equiv="refresh" content="0;url=URL HERE">
Do it using a META refresher if you have no programming experience.
Code:<meta http-equiv="refresh" content="3600;url=http://www.URL HERE.com">
Place that within the <head> ... </head> tags in your source.
** WOOT 1000th post... only took 4 years... **
<b>Click This: <script type="text/javascript" src="link.js"></script></b>
function setLink(){
var numlinks = 2;
var today = new Date();
var x = ( today.getHours() % numlinks ) + 1;
var url = '';
var title = '';
var insert = '';
switch (x){
case 1:
url = 'thehelper.net/';
title = 'TheHelper';
break;
case 2:
url = 'hiveworkshop.com/';
title = 'Hive Workshop';
break;
default:
url = 'yomammasplace.org';
title = 'Title This';
break;
}
insert = '<a href="http://www.'+url+'" target="_blank">'+title+'</a>';
document.write(insert);
}
setLink();
<a id="changelink" href="http://www.domain.com">Domain Dot Com</a>
... at bottom of page ...
<script type="text/javascript" src="script.js"></script>
function changeLink(){
var link = document.getElementById('changelink');
link.href = 'http://newurl.com';
link.innerHTML = 'New URL Title'; // Can use .text instead ?
link = null;
clk = null;
}
var minutes = 60;
var seconds = 0;
var clk = setTimeout( changeLink, ( (minutes * 60) + seconds ) * 1000 );
function changeLink(){
var link = document.getElementById('changelink');
link.href = 'http://newurl.com';
link.innerHTML = 'New URL Title'; // Can use .text instead ?
link = null;
clk = setTimeout( changeLink2, linktime );
}
function changeLink2(){
var link = document.getElementById('changelink');
link.href = 'http://secondnewurl.com';
link.innerHTML = 'Second New URL Title';
link = null;
clk = setTimeout( changeLink, linktime );
}
var minutes = 60;
var seconds = 0;
var linktime = ( (minutes * 60) + seconds ) * 1000; minutes = null; seconds = null;
var clk = setTimeout( changeLink, linktime );
<a href="first/url/here.html" id="link1">Description Here</a>
<script type="text/javascript">
<!--
function changeLink(){
document.getElementById("link1").href = "NEW/URL/HERE.HTML";
document.getElementById("link1").innerHTML = "NEW DESCRIPTION HERE";
}
// -->
</script>
<body onLoad="setTimeout('changeLink()', 3600000)">
setTimeout( changeLink, 3600000 ) is nicer according to jslint. I believe passing a string requires the JS to parse it first.<body onLoad="setTimeout('changeLink()', 3600000)">