creating a linux terminal themed website using html and javascript

You need to comma separate the functions.

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://unpkg.com/jquery.terminal/js/jquery.terminal.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/jquery.terminal/css/jquery.terminal.min.css"/>
</head>
<body>
    <script>
$('body').terminal({
    cat: function() {
        this.echo($('<img src="https://placekitten.com/408/287">'));
    },
    dog: function(v){
        this.echo('hello ' + v);
    }
});
    </script>
</body>
</html>

As you’ve added a v paramater in there, for it to work you have to type “dog 1” or “dog anything”, else remove the v function/param and continue 🙂

To answer the part about resources and learning, just go learn the basic fundamentals of JavaScript/jQuery and the rest will make sense – while jumping in to the deep end right away is a way to learn, sometimes you gotta go back to basics and there are countless videos and articles that can teach you the basics, they’re all just a simple Google away.

JavaScript/jQuery/HTML all follow a basic foundation and once you learn those then you can have a bit more fun with the advanced stuff. You’re basically trying to build a roof of a house before you’ve built the walls to put it on.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top