current location:Home > Technical Articles > Web Front-end
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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