I'm using this: http://terminal.jcubic.pl/
I want to output something, and have that output be a hyperlink that when clicked would output something else.
jQuery(document).ready(function($) {
$('#terminal').terminal(function(cmd, term) {
term.echo('\nClick this: <a onClick="javascript:terminal.exec(\'somethingelse\')">somethingelse</a>', {raw: true});
}, {
greetings: "Welcome!\n",
onInit: function(terminal) {
terminal.echo('Welcome!');
},
prompt: '> '
});
});
However,
<a onClick="javascript:terminal.exec
doesn't work because terminal.exec isn't defined in the context of the window. What would be the proper way to do it?
Thanks!
onclickin JavaScript and not inline HTML, and define it where the function is defined in your code.$('#terminal').terminal(function(cmd, term) {so how would that work?