PDA

View Full Version : Tip of the day script help please



Collectors-info
03-24-2008, 10:14 AM
Hi, i have been trying to add a url link into this tip of the day javascript & it dosnt want to except it. On tip 24 , as soon as i add the
<a href="http://www.collectors-info.com" target="_top">testing for a url link</a>
It stops working.
Any ideas on adding a url link or image link to show on the day?

Thanks.
PS. I realize this tip 24 may be out of date in some areas soon.


<script language="JavaScript">
/*Tip Of The Day Script
Created By MikeW at mikew@dvol.com. Copyright 2000 by MikeW - Please leave all credits in place if useing this script. Featured on A1 javaScripts, www.a1javascripts.com (http://www.a1javascripts.com)
Promoted by http://www.webbiesite.com*/

//Make new array and get the current day in var today
var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();
//put the tip of the day in each msg[x] string
//change tips each month, automatically switches every day
msg[0]="Tip 1"
msg[1]="Tip 2"
msg[2]="Tip 3"
msg[3]="Tip 4"
msg[4]="Tip 5"
msg[5]="Tip 6"
msg[6]="Tip 7"
msg[7]="Tip 8"
msg[8]="Tip 9"
msg[9]="Tip 10"
msg[10]="Tip 11"
msg[11]="Tip 12"
msg[12]="Tip 13"
msg[13]="Tip 14"
msg[14]="Tip 15"
msg[15]="Tip 16"
msg[16]="Tip 17"
msg[17]="Tip 18"
msg[18]="Tip 19"
msg[19]="Tip 20"
msg[20]="Tip 21"
msg[21]="Tip 22"
msg[22]="Tip 23"
msg[23]="Tip 24<br>Test for text<br><a href="http://www.collectors-info.com" target="_top">testing for a url link</a>"
msg[24]="Tip 25"
msg[25]="Tip 26"
msg[26]="Tip 27"
msg[27]="Tip 28"
msg[28]="Tip 29"
msg[29]="Tip 30"
msg[30]="Tip 31"
//write todays tip so that the tip number matches with the day
document.write(msg[today-1]);
</script>

Vasili
03-24-2008, 10:38 AM
try inserting a real link ...to "test," that is!

Assuming also that the remainder of the array is properly completed, so the script can "run," right?

Collectors-info
03-24-2008, 04:34 PM
try inserting a real link ...to "test," that is!

Assuming also that the remainder of the array is properly completed, so the script can "run," right?

Hi Vasili, not quite sure what you mean (a real link)? If i remove this part.......
<a href="http://www.collectors-info.com" target="_top">testing for a url link</a>
The script works fine. I made sure the link was ok & this works fine. But they don't like being together. Wasn't sure if links were entered in a different way when using JavaScript?

Aliens Anonymous
03-24-2008, 07:35 PM
The part between the " " is for text only. msg[22]="Tip 23" plus putting // in there cancels the rest out so anything after the // is not reconized. the // is offten used by the script writer to explian denote something. mainly in php. therefore you will always get the error messages in ie anyway like object ","
this how the // is used in php .

// check there's a form ID included
else if (empty($_POST['form_tools_form_id']))
ft_output_message("no_form_id");

Vasili
03-24-2008, 08:13 PM
http://www.vodahost.com/vodatalk/images/icons/icon10.gif <looking for a juicy spammer to feed our favorite Alien!>

Collectors-info
03-24-2008, 08:13 PM
Thanks for looking Aliens. Was worth a try.
But! have found a similar one that uses iframes that should do the trick.
http://www.dynamicdrive.com/dynamicindex17/dowiframe2.htm

Cheers.