LABjs: how to deal with inline code

This is a quickie how-to post to help address a couple little gotchas you may run into when implementing LABjs onto your site.
Consider standard page code like this:

<script src=”framework.js”></script>
<script src=”myscript.js”></script>
<script>
myscript.init();
</script>
<script>
framework.init();
framework.doSomething();
</script>

In this example, “myscript.init” is a function that is defined in “myscript.js”, and “framework.init” and “framework.doSomething” are both defined inside [...]

Posted in: JavaScript by getify 8 Comments ,

LABjs: why not just concat?

Update
[8/12/2010: I've posted a performance benchmark test to try and gather some numbers from the crowd-at-large on how single large concat'd files perform compared to chunking that big file into a couple of smaller files to download in parallel. I encourage you to go right now and click each of the buttons a few times, [...]

LABjs: new hotness for script loading

What, you mean to tell me you’re not already loading your scripts with the new hot thing, LABjs?
Just kidding, you’re probably just now starting to hear about it. But let me tell you, it is the next big thing. I mean, when was the last time someone found a way to completely revamp the plain [...]

Why DOM-ready still sucks

For those of you who are familiar with JavaScript libraries, you are probably at least a little bit aware that there is an “event” that occurs during the loading of a page which abstractly represents the point in time in which the browser has fully processed the structure (aka, the “DOM”) of the HTML document [...]

Resource Packaging? Silver Bullet?

There’s been some buzz lately about a proposal for a technique of UI delivery optimization called Resource Packaging. Steve Souders weighed in on the proposal with resounding support.
Essentially, the idea is that web developers could proactively create .ZIP files of various page resources (images, CSS, JS, etc), and include in their page a special <link> [...]

Loading JavaScript: Even a caveman can do it

I recently gave a talk about JavaScript Loading at JSConf.EU in Berlin. Video/audio of the talk will be made available online eventually, and I will link to it here once that happens. But, in fact, I will be re-presenting this same talk at the November meeting of Austin.Javascript (@AustinJS), on Tues Nov 17th, at 7:30pm. [...]

Switch to our mobile site