Skip to content

Instantly share code, notes, and snippets.

@tpryan
Created August 20, 2010 20:15
Show Gist options
  • Save tpryan/541051 to your computer and use it in GitHub Desktop.
Save tpryan/541051 to your computer and use it in GitHub Desktop.
<cf_pageWrapper>
<cf_uiWidget />
</cf_pageWrapper>
<cfprocessingdirective suppresswhitespace="yes">
<cfif thisTag.executionMode is "start">
<cfset request.footer= ""/>
<html>
<head>
<title>Test</title>
</head>
<body>
<cfelse>
<cfoutput>#request.footer#</cfoutput>
</body>
</html>
</cfif>
</cfprocessingdirective>
<html>
<head>
<title>Test</title>
</head>
<body>
<p>uiWidgetComponent content</p>
<button name="test" value="Press me" onclick="buttonhandler()">
Press me
</button>
<script type="application/javascript">
function buttonhandler(){
alert("Yo");
}
</script>
</body>
</html>
<cfprocessingdirective suppresswhitespace="yes">
<cfif thisTag.executionMode is "start">
<p>uiWidgetComponent content</p>
<button name="test" value="Press me" onclick="buttonhandler()">
Press me
</button>
<cfsavecontent variable="jsToInject">
<script type="application/javascript">
function buttonhandler(){
alert("Yo");
}
</script>
</cfsavecontent>
<cfset request.footer = request.footer & jsToInject />
</cfif>
</cfprocessingdirective>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment