Create a new JavaScript file using your favorite editor or IDE
Add the following source code to your file (original source here)
define([], function () {
/**
* A simple "Hello, World!" example of a Client Script. Uses the `pageInit`
* event to write a message to the console log.
*
* @NApiVersion 2.x
* @NModuleScope Public
* @NScriptType ClientScript
*/
var exports = {};
function pageInit(context) {
console.log("Hello, World from a 2.0 Client Script!");
}
exports.pageInit = pageInit;
return exports;
});
Save the file as hello-world2.js
wherever you wish
hello-world2.js
as the Script File