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#">';
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson