Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Code highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrove committed Sep 30, 2011
1 parent 1a2df18 commit 6d9fc3f
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions README.md
Expand Up @@ -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
------------------
Expand Down

0 comments on commit 6d9fc3f

Please sign in to comment.