CFLib.org – Common Function Library Project

prefetchLink(link[, title])

Last updated August 22, 2005

author

Wayne Graham

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Creates the prefetch directive for Mozilla/Firefox to load pages into the browser cache while the browser is idle.

Return Values:
Returns a string.

Example:

<cfset link = "http://www.cflib.org" />
<cfset title = "CFLib.org" />

<cfoutput>
	#prefetchLink(link, title)# <a href="#link#" title="#title#">#title#</a>
</cfoutput>

Parameters:

Name Description Required
link Link for prefetching. Yes
title Title for prefetched resource. No

Full UDF Source:

/**
 * Creates the prefetch directive for Mozilla/Firefox browsers.
 * For more information on link prefetching see http://www.mozilla.org/projects/netlib/Link_Prefetching_FAQ.html#What_are_the_prefetching_hints
 * 
 * @param link 	 Link for prefetching. (Required)
 * @param title 	 Title for prefetched resource. (Optional)
 * @return Returns a string. 
 * @author Wayne Graham (wsgrah@wm.edu) 
 * @version 1, August 22, 2005 
 */
function prefetchLink(link){
	if(arrayLen(arguments) gte 2) return '<link rel="prefetch" href="#arguments.link#" title="#arguments[2]#" />';
	 return '<link rel="prefetch" href="#arguments.link#">';
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson