Skip to content
the poor coder

programming javascript

Poor Man
Published
Reading time
1 min read
On this page

Programming Javascript#

Javascript is a programming language that is used to add interactivity and dynamic behavior to websites. It is a client-side language, which means it runs in the user's web browser. There are several ways to program in Javascript, including using vanilla Javascript, jQuery, and frameworks such as React and Angular.

Vanilla Javascript#

Vanilla Javascript refers to using pure, unmodified Javascript code to add functionality to a website. This can include manipulating the DOM, handling events, making API calls, and more. The code can be written directly in a script tag in the HTML file or in a separate Javascript file that is linked to the HTML file.

Text

      // Example of adding a click event listener to a button
      const button = document.querySelector('#myButton');
      button.addEventListener('click', function() {
        alert('Button clicked!');
      });
    

jQuery#

jQuery is a popular Javascript library that simplifies the process of writing Javascript code. It provides a set of methods and functions that can be used to manipulate the DOM, handle events, make Ajax calls, and more. jQuery is often used when supporting older browsers that may not have the latest Javascript features.

Text

      // Example of adding a click event listener to a button using jQuery
      $('#myButton').click(function() {
        alert('Button clicked!');
      });
    

Frameworks#

Frameworks such as React and Angular provide more structure to Javascript code and allow for the creation of complex web applications. They include pre-built components and modules that can be used to build the application, as well as tools for managing state and data flow. These frameworks use a combination of HTML, CSS, and Javascript to create components and render them to the DOM.

Text

      // Example of a React component
      import React from 'react';

      function MyComponent(props) {
        return (
          
            {props.title}
            {props.content}
          
        );
      }
    

Keep going

2023

how to sort an array

How to Sort an Array If you have an array and you want to order its elements in a specific way, you need to use a sorting algorithm. There are several sorting algorithms available, but two of the most commonly used are…

javascript2 min read
2023

jquery mobile or desktop

jQuery Mobile or Desktop? As a web developer, I have had some experience with both jQuery Mobile and jQuery Desktop. Both frameworks have their pros and cons, and which one to use really depends on the specific project…

javascript1 min read
2023

node.js folder structure

Node.js Folder Structure If you are new to Node.js, it can be daunting to create a folder structure that will work for your project. The structure you choose will depend on the size and complexity of your project. Here…

javascript1 min read
ESC