current location:Home > Technical Articles > Web Front-end

  • The Importance of Writing Code That Humans Can Read
    The Importance of Writing Code That Humans Can Read
    Key Points Clarity first: Readable code improves maintainability and collaboration, and writing easy-to-understand and modify code is crucial. Function and file management: Use functions to encapsulate reusable code and split large files into smaller, more manageable parts to simplify navigation and understanding. Naming Convention: Choose clear and descriptive names for functions and variables to improve readability and reduce the need for additional comments. Avoid over-optimization: While concise and optimized code is attractive, readability should be prioritized when performance impact is not significant, because modern JavaScript engines are very efficient in code optimization. Comment with caution: Use comments to explain "why" do this, rather than "do"
    JS Tutorial 508 2025-02-18 10:52:10
  • JavaScript Arrays: How to Create and Manipulate
    JavaScript Arrays: How to Create and Manipulate
    Easy to understand JavaScript arrays: Detailed explanation of creation and operation Core points JavaScript arrays have a length attribute, can be operated, and have a numbered attribute with names ranging from 0 to 4294967294 (inclusive). JavaScript does not support associative arrays. JavaScript arrays are created in various ways, and it is recommended to use array literals to create new arrays. The array can be intensive (length equals the number of numbered attributes) or sparse (length greater than the number of numbered attributes). The length of the JavaScript array can be changed. If the new length is set less than the current length, any numbered attributes in the array that are positioned greater than the new length will be removed. Java
    JS Tutorial 596 2025-02-18 10:50:10
  • How to Implement Smooth Scrolling in Vanilla JavaScript
    How to Implement Smooth Scrolling in Vanilla JavaScript
    Core points Use Jump.js library to implement native JavaScript smooth scrolling, simplifying scrolling animation without external dependencies. Modify Jump.js original code to convert it from ES6 to ES5 to ensure wider compatibility with different browsers. Use the requestAnimationFrame method to perform smooth animation updates, optimize performance and provide a smoother user experience. Implement custom JavaScript to intercept the default in-page link behavior and replace sudden jumps with smooth scrolling animations. Integrate the CSS scroll-behavior attribute to support native smooth scrolling in browsers that recognize this feature, and provide Java if the browser does not support it
    JS Tutorial 538 2025-02-18 10:49:09
  • Mastering $watch in AngularJS
    Mastering $watch in AngularJS
    Core points The $watch function in AngularJS is a powerful tool for observing changes in variable values ​​or expressions. When a change is detected, it triggers a callback function that is executed every time the monitored variable changes. $watch is compared using JavaScript's equality operator (===). If the new value is different from the old value, the callback function is triggered. However, it should be noted that by default $watch only checks for reference equality, which means that the callback function is triggered only when a new value is assigned to the monitored variable. AngularJS also provides $watchGroup and $watchCollection as convenient shortcuts, respectively
    JS Tutorial 789 2025-02-18 10:47:09
  • Understanding Components in Ember 2
    Understanding Components in Ember 2
    Key Points The Ember component is the core of Ember applications, allowing developers to define custom, application-specific HTML tags and implement their behavior using JavaScript. In Ember 2.x, components replace views and controllers. The Ember component contains a Handlebars template file and a companion Ember class. These components can be used with other components, and can even be nested in parent components and have properties similar to native HTML elements. Dynamic data can be added to the Ember application through a model (the object representing the underlying data the application presents to the user). This allows the creation of interactive and dynamic components. Can use actions (send to component
    JS Tutorial 570 2025-02-18 10:43:11
  • 10 jQuery Horizontal Scroll Demos & Plugins
    10 jQuery Horizontal Scroll Demos & Plugins
    This post showcases 10 jQuery horizontal scroll demos and plugins, perfect for those who prefer horizontal navigation. We've updated all plugins and demos with the latest versions and added some new ones. ScrollMagic: A lightweight (6KB gzipped),
    JS Tutorial 334 2025-02-18 10:42:10
  • A Closer Look at Angular's ngMessages Module
    A Closer Look at Angular's ngMessages Module
    Key Highlights: AngularJS's ngMessages module streamlines error message display in forms, leveraging templates and animation capabilities. Introduced in AngularJS 1.3, it remains a core directive, continually enhanced for improved functionality. Th
    JS Tutorial 1083 2025-02-18 10:41:09
  • Creating a GraphQL Server with Node.js and MongoDB
    Creating a GraphQL Server with Node.js and MongoDB
    Key Takeaways Utilize Node.js and Express to establish a server and integrate MongoDB with Mongoose for data management, enhancing the server’s ability to handle queries and mutations efficiently. Implement GraphQL on the server using the expres
    JS Tutorial 983 2025-02-18 10:37:13
  • Custom PDF Rendering in JavaScript with Mozilla's PDF.Js
    Custom PDF Rendering in JavaScript with Mozilla's PDF.Js
    Peer reviewed by Jani Hartikainen, Florian Rappl, Jezen Thomas, and Jeff Smith. Thanks to SitePoint's peer reviewers for their contributions! Most modern browsers natively support PDF viewing, but this functionality is beyond a developer's direct co
    JS Tutorial 1002 2025-02-18 10:36:13
  • Learn about CSS Architecture: Atomic CSS - SitePoint
    Learn about CSS Architecture: Atomic CSS - SitePoint
    The following excerpts are from the book "The Master of CSS" written by Tiffany Brown. This book is available in major bookstores around the world, and you can also purchase the e-book version here. If BEM is the darling in the industry, then Atomic CSS is its rebellious trendsetter. Yahoo's Thierry Koblentz named and explained Atomic CSS in his 2013 article Challenging CSS Best Practices, which uses a compact library of class names. These class names are usually abbreviated and are out of touch with what they affect. In the Atomic CSS system, you can know what the class name does; however, there is no relationship between the class names—at least, the class name and content type used in the style sheet
    CSS Tutorial 446 2025-02-18 10:35:09
  • Using HTML5's Native Drag and Drop API
    Using HTML5's Native Drag and Drop API
    This article explores the HTML5 Drag and Drop API, a powerful tool for creating interactive web interfaces. It simplifies the process of enabling drag-and-drop functionality, eliminating the need for complex JavaScript solutions. The API utilizes na
    JS Tutorial 877 2025-02-18 10:29:08
  • Create a Tabbed Browser Using Node-Webkit and AngularJS
    Create a Tabbed Browser Using Node-Webkit and AngularJS
    Key Takeaways Node-Webkit (now NW.js) combines Node.js and WebKit to enable development of native applications using web technologies like HTML, CSS, and JavaScript, streamlining cross-platform software development. The tutorial demonstrates cre
    JS Tutorial 997 2025-02-18 10:25:07
  • Sending Emails with the Gmail JavaScript API
    Sending Emails with the Gmail JavaScript API
    This article demonstrates building a Gmail app using the Gmail JavaScript API, extending a previous example to include email sending, composing, and replying. No prior knowledge of the previous article is required. The complete source code is avail
    JS Tutorial 937 2025-02-18 10:23:10
  • Functional Reactive Programming with Elm: An Introduction
    Functional Reactive Programming with Elm: An Introduction
    Core points Elm is a functional programming language compiled into JavaScript, focusing on simplifying and enhancing front-end development. It uses type inference, is reactive and combines functional programming patterns such as pure views, reference transparency, and immutable data. Elm uses modes such as immutable data, pure views describing the DOM, one-way data streams, centralized state and centralized data variation descriptions, and limited side effects. These patterns make applications easier to predict, maintain, and robust. Elm's security features avoid the possibility of a value being empty, forcing developers to handle all alternative paths in the application. This provides a lot of confidence for the application and rarely sees runtime errors in Elm applications.
    JS Tutorial 264 2025-02-18 10:21:39
  • Sinon Tutorial: JavaScript Testing with Mocks, Spies & Stubs
    Sinon Tutorial: JavaScript Testing with Mocks, Spies & Stubs
    This article is reviewed by Mark Brown and Marc Towler. Thanks to all SitePoint peer reviewers for getting SitePoint content to its best! One of the biggest obstacles when writing unit tests is how to deal with non-trivial code. In actual projects, the code often performs various operations that make testing difficult. Ajax requests, timers, dates, access to other browser features…or databases are always fun if you are using Node.js, so are network or file access. All of this is hard to test because you can't control them in your code. If you are using Ajax, you need a server to respond to the request so
    JS Tutorial 718 2025-02-18 10:13:13

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28