ClickOnChris

Christopher G Johnson: programmer, entrepreneur

Archive for the ‘Javascript’ Category

No Fluff Just Stuff 2011, Madison, WI

without comments

I attended the No Fluff Just Stuff conference in Madison, WI this weekend. It was a great chance to learn the newest Java trends and share struggles in programming with people much like myself, even if most of them were cheeseheads. Here are some of my reflections on the state of Java tech post-conference:

-Java 7 is underwhelming, mostly because it will not have closures. It will however introduce enhancements to speed up Groovy, JRuby, and Scala

-If I read between the lines what features are in HTML and any of them are supported by Chrome, then I think that HTML5+Chrome could easily turn into a gaming platform!

-There is no question that Groovy is the “next big thing” for Java. Get on board.

-A java developer could easily add Hadoop to his resume (and dollars to his pocket), by learning Hadoop with Cascading. Hadoop-worthy scale data sets are available for free from amazon: http://aws.amazon.com/publicdatasets/

Grails is really cool. I wish there was a hosting platform available that was anything close to Heroku for Rails. I think it is unlikely that we will hear any good Startup stories with Grails for that reason.

Written by clickonchris

February 27th, 2011 at 1:54 pm

Facebooker2 Demo Video

with one comment

I published my first ever screen cast tonight. enjoy!

The source code is available here: https://github.com/clickonchris/facebooker-demo

Written by clickonchris

February 6th, 2011 at 3:08 am

Facebook Javascript SDKs – Old vs. New

without comments

There are two ways to handle initializing your fb:serverFBML tags

1 – using the New Javascript SDK
doc: http://developers.facebook.com/docs/reference/javascript/

(identified by the js library http://connect.facebook.net/en_US/all.js)

<script src="http://connect.facebook.net/en_US/all.js"></script> 
<script type="text/javascript">
   FB.init({appId: 'your app id',
        status: true,
      cookie: true,
      xfbml: true});
   FB.Event.subscribe('auth.sessionChange', function(response) {
     if (response.session) {
       // A user has logged in, and a new cookie has been saved
     } else {
       // The user has logged out
     }
   });
</script>

2 – Using the Old Javascript SDK
which is what our friends at StackOverflow have done. I reference this thread because it kept coming up while I was solving this problem, and the solution they give is outdated.

http://stackoverflow.com/questions/820421/can-i-use-facebooks-fbfriend-selector-in-an-iframe

(identified by the js library http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php and xd_receiver.html)
doc:http://developers.facebook.com/docs/reference/oldjavascript/


<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
    FB_RequireFeatures(
        ["CanvasUtil"],
        function(){
                 FB.XdComm.Server.init('/xd_receiver.html');
                 FB.CanvasClient.startTimerToSizeToContent();
        }
    );
</script>

<script type="text/javascript">
    FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("Your Facebook API Key", "/xd_receiver.html"); });       
</script>

Written by clickonchris

November 8th, 2010 at 11:48 pm

Posted in Facebook,Javascript

JavaScript Documentation

without comments

It can be tough to find a decent JavaScript reference.  This one is my favorite:

JavaScript Language Reference: https://developer.mozilla.org/en/JavaScript/Reference

JavaScript Number Example: Using the Number object to assign values to numeric variables

Other great javascript links:

JQuery Reference: http://docs.jquery.com/Main_Page

Closure Compiler: http://code.google.com/closure/compiler/

Written by clickonchris

October 18th, 2010 at 8:35 pm

A Better Window.onLoad with jQuery

without comments

I have recently come to discover the javascript library jQuery. My favorite feature is the window.onLoad replacement, which is actually faster than window.onLoad and can be used multiple times in one document.

<span style="color: #008000;">  $(document).ready(function(){
    // Your code here...
  });</span>

Any code in the Your code here.. block will execute as soon as the page is loaded. This is useful for referencing DOM elements which would have been “undefined” before the page was fully loaded by the browser.

Written by clickonchris

December 23rd, 2008 at 9:02 pm

Switch to our mobile site