Deprecated: Assigning the return value of new by reference is deprecated in /home/bwcom/brianwiese.com/wiki/inc/parserutils.php on line 159

Deprecated: Assigning the return value of new by reference is deprecated in /home/bwcom/brianwiese.com/wiki/inc/parserutils.php on line 162

Deprecated: Assigning the return value of new by reference is deprecated in /home/bwcom/brianwiese.com/wiki/inc/parserutils.php on line 292

Deprecated: Function split() is deprecated in /home/bwcom/brianwiese.com/wiki/inc/auth.php on line 103

Warning: Cannot modify header information - headers already sent by (output started at /home/bwcom/brianwiese.com/wiki/inc/parserutils.php:159) in /home/bwcom/brianwiese.com/wiki/inc/auth.php on line 191

Deprecated: Function split() is deprecated in /home/bwcom/brianwiese.com/wiki/inc/common.php on line 552

Warning: Cannot modify header information - headers already sent by (output started at /home/bwcom/brianwiese.com/wiki/inc/parserutils.php:159) in /home/bwcom/brianwiese.com/wiki/inc/actions.php on line 76
js:customlink [bw.net notes]
 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bwcom/brianwiese.com/wiki/inc/html.php on line 149

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/bwcom/brianwiese.com/wiki/inc/html.php on line 152

< code

Create Custom YYMMDD Javascript Link

  • You can place all of the code here within your “BODY” tags on the webpage to make it work.
  • To test, simply copy and paste the below code into the w3schools TryIt page between the “BODY” tags.
<script type="text/javascript">
<!--

function getTodaysReading()
{

var d = new Date();
var year = d.getFullYear();
yearYY = year.toString();
var YY = yearYY.substr(2,4)

var month = d.getMonth() + 1;
month = ((month < 10) ? "0" : "") + month;
var MM = month;

var date = d.getDate();
date = ((date < 10) ? "0" : "") + date;
var DD = date;

document.write("<a href='http://www.usccb.org/nab/readings/");
document.write(YY + MM + DD);
document.write(".shtml'>Today's Mass Readings</a>");
}
-->
</script>

<script>getTodaysReading();</script><br/>

Notes

  • Note however, that the simple <A HREF=”javascript:myfunction()”>Click Here</A> like this would not work with Firefox! For some reason, Firefox can’t write JS within an HREF tag, the JS function must write the HREF.
 
js/customlink.txt · Last modified: 2009/01/03 09:38 by bw
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki