Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-04-2012, 12:59 AM   PM User | #1
Wolowizard
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Wolowizard is an unknown quantity at this point
Help a noob with Java/DOM and time-stamped links

Hi there, apologies to any mods if this is in the wrong section.

I am a total novice to code, and need some help.

I have a page on my website which has a javascript box, that generates 10 time-stamped facebook links for me to click - this is the code:

Code:
<script type="text/javascript">
<!--
var d = new Date()

month=(d.getUTCMonth()+1).toString();
if(month.length<2) month = "0" + month;

day=(d.getUTCDate()).toString();
if(day.length<2) day = "0" + day;

hour=(d.getUTCHours()).toString();
if(hour.length<2) hour = "0" + hour;

minute=(d.getUTCMinutes()).toString();
if(minute.length<2) minute = "0" + minute;

for (x=1 ; x<=10 ; x++)
{
    xx = x.toString();    
    if (xx.length<2) xx = "0" + xx;
    
    h= "http://xxxxxxxxxxxxxxx/xxxxxxxxxxxx/facebook.xxxxxxxxxx.php?F=xxxxxxxxxxxxxxxxx=" + d.getUTCFullYear() + "." + month + "." + day + "+" + hour + "." + minute + "." + xx + "xxxxxxxxxxxxxxxxxx";
    document.writeln("<p>"+("Link "+x).link(h)+"</p>");";
    document.writeln("<p>"+("Link "+x).link(h)+"</p>");
}
//-->
</script>
What I need to do, is to get these links generated every 8 hours, and automatically clicked to save anyone having to click them manually.

Is this possible? If so how do I do it and where do I go to learn how to do it?

I am guessing that code is fine and I have to write something for insertion into my server, but have no clue where to start or how to do it.

Thanks

ps - also, what do I write into that script so the links generated open in a new tab?
Wolowizard is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:37 PM.


Advertisement
Log in to turn off these ads.