$.getScript will load and execute JavaScript. If you want to just load the javascript, you will have to put the javascipt in a function, and then execute that function when a future event occurs.
suppose you call:
$.getScript('http://example.com/hello.js');
and it contains the following:
function Hello() {
alert('hello');
}
The javascript will be executed, but since the alert is in the function it won't be ran. It won't be ran until you call the function Hello(). So for the second part, suppose you want to wire it so that when a link is clicked the Hello() function is ran. You can provide a callback to run after the javascript is loaded. So you could do this:
$.getScript('http://example.com/hello.js', function() { Hello(); });
After the script is loaded, that will set a click event handler on your links which will call the Hello function.