Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



14 Commits

Repository files navigation

What is jquery-run?

Significantly speed up your pages! Load JS on-demand.

Lazy load your javascripts. (the first time it requred).

Once loaded scripts are cached. No loads for subsequent calls.


// load script once, then call callback function
$.run("/js/script.js", function() { ... } );

// load script, then call func(param1, .. paramX)
$.run("/js/script.js", "func", param1, ..., paramX)

// shortcut for $.run("/js/script.js", ...)
$.run(":script", ...)


<a href=# onclick='$.run("/js/test.js", "test", 1, "parf")'>$.run("url", "func", ..)</a>
<a href=# onclick='$.run(":test", "NS.test", "parf")'>$.run(":script", "Namespace.Function", ..)</a>
<a href=# onclick='$.run(":test", function() {test(1,2,3)} )'>$.run(":script", function() {...})</a>

<!-- AHM ( ) lets you call client javascript functions from server -->
<a href="/a.jquery-run-test" class="ahm">AHM</a><span id="test"></span>
Server response:
{"#test":"ahm call complete","\/$.do":[":test","test",1,2,3,"parf"]}

function test() {
   console.log("test.js test(...)", arguments);

// namespace
var NS = { 
    test: function () {
        console.log("NS.test", arguments);

Future Development

$.run("file.html", ..) // load & execute scripts inside htmls
$.run("file.css", ..) // load styles, ...
$.run(["script", "file.html", "file.css"], ..) // load several files, then execute something


MIT License @

See Also

JqueryAHM - - jquery-run big brother - simplify your htmls/javascripts even more


jQuery 1.5+