This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
public numeric function addOne(a){ | |
return add(1,a); | |
} | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
test = new test(); | |
writeOutput( test.add( 1, 1 ) ); | |
writeOutput( test.add( 1, 2 ) ); | |
writeOutput( test.add( 1, 3 ) ); | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
public numeric function add(a, b){ | |
return a + b; | |
} | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myStruct = { | |
def : "defined", | |
undef : javaCast("null","") | |
}; | |
writedump(var=myStruct,output="browser"); | |
writeOutput("<br>"); | |
writeDump(structKeyExists(myStruct,"undef")); | |
writeOutput("<br>"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getTweets = function(searchURL){ | |
return $.Deferred(function(dfd){ | |
$.ajax({ | |
url : searchURL, | |
dataType : 'jsonp', | |
success : function(data){ | |
//make sure what we got back valid data from twitter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cleanDiv = function(){ | |
return $.Deferred(function(dfd){ | |
//otherwise fade the dive out before removing the children | |
$tweetDiv.fadeOut('slow',function(){ | |
$tweetDiv.children().remove(); | |
dfd.resolve(); | |
}); | |
}).promise(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tweetClickHandler = function(e){ | |
var $that = $(this); | |
//while we are cleaning up the div go ahead and get | |
//the tweets | |
$.when( | |
getTweets($that.find('a').data('link')) | |
//since we care weather the dfd was resolved or rejected we use the .done method | |
//this only fires when the dfd is resolved | |
).done( | |
//each function we call in the when will pass its response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tweetClickHandler = function(e){ | |
cleanDiv(); | |
getTweets($(this).find('a').data('link')); | |
$tweetDiv.fadeIn('slow'); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var $tweetDiv = $("#tweets>div"); | |
var tweetClickHandler = function(e){ | |
cleanDiv(); | |
getTweets($(this).find('a').data('link')); | |
$tweetDiv.fadeIn('slow'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var $tweetDiv = $("#tweets>div"); | |
$('li').on('click',function(){ | |
var $that = $(this); | |
//while we are cleaning up the div go ahead and get | |
//the tweets | |
$.when( | |
getTweets($that.find('a').data('link')) | |
//since we care weather the dfd was resolved or rejected we use the .done method |