Menu

Script Loading

James Stortz

Loading/Executing External JavaScript & Modules

asynchronous javascript and xml

Ajax

| OVERVIEW

Loading/Executing external JavaScript should be simple and universal, on.js makes everything possible in one easy step.

| KEYWORDS

| ARGUMENTS

| COMMANDS

  • 'load script'
  • 'load module'

JAVASCRIPT

('load script')[on]("../the-script-file.js")
(   function()      //the function to be executed after the script file has loaded
    {        
    }
);

PUBLIC MODULE

('load module')[on]("../the-module-file.js")
(   function()      //the function to be executed after the script file has loaded
    {        
        this;           //the public scope of the module (access to global)
        any_variable;       //any variable in the global scope
    }
);

PRIVATE MODULE

('load module')[on]("../the-module-file.js")
(   function(private)   //the function to be executed after the script file has loaded
    {        
        this;           //the private scope of the module (no access to global)
        any_variable;       //any variable in the private scope of the module
    }
);

on.js

return true;

A JavaScript Library


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.