Permalink
Browse files

Code highlighting.

  • Loading branch information...
1 parent 1a2df18 commit 6d9fc3f8f1ff6ca0a43373cac7430a1ce330eaab @rgrove committed Sep 30, 2011
Showing with 21 additions and 19 deletions.
  1. +21 −19 README.md
View
40 README.md
@@ -30,25 +30,27 @@ You can also provide a callback function if you'd like to be notified when the
resources have finished loading, as well as an argument to pass to the callback
and a context in which to execute the callback.
- // Load a single JavaScript file and execute a callback when it finishes.
- LazyLoad.js('http://example.com/foo.js', function () {
- alert('foo.js has been loaded');
- });
-
- // Load multiple JS files and execute a callback when they've all finished.
- LazyLoad.js(['foo.js', 'bar.js', 'baz.js'], function () {
- alert('all files have been loaded');
- });
-
- // Load a CSS file and pass an argument to the callback function.
- LazyLoad.css('foo.css', function (arg) {
- alert(arg);
- }, 'foo.css has been loaded');
-
- // Load a CSS file and execute the callback in a different scope.
- LazyLoad.css('foo.css', function () {
- alert(this.foo); // displays 'bar'
- }, null, {foo: 'bar'});
+```js
+// Load a single JavaScript file and execute a callback when it finishes.
+LazyLoad.js('http://example.com/foo.js', function () {
+ alert('foo.js has been loaded');
+});
+
+// Load multiple JS files and execute a callback when they've all finished.
+LazyLoad.js(['foo.js', 'bar.js', 'baz.js'], function () {
+ alert('all files have been loaded');
+});
+
+// Load a CSS file and pass an argument to the callback function.
+LazyLoad.css('foo.css', function (arg) {
+ alert(arg);
+}, 'foo.css has been loaded');
+
+// Load a CSS file and execute the callback in a different scope.
+LazyLoad.css('foo.css', function () {
+ alert(this.foo); // displays 'bar'
+}, null, {foo: 'bar'});
+```
Supported Browsers
------------------

0 comments on commit 6d9fc3f

Please sign in to comment.