<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Thara on Medium]]></title>
        <description><![CDATA[Stories by Thara on Medium]]></description>
        <link>https://medium.com/@tharuksika09?source=rss-48c12fe8e21e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HZzWutHxNQEmdfqZg3tzeA.jpeg</url>
            <title>Stories by Thara on Medium</title>
            <link>https://medium.com/@tharuksika09?source=rss-48c12fe8e21e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 22:08:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tharuksika09/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Servers Bring Your Website Online]]></title>
            <link>https://medium.com/@tharuksika09/how-servers-bring-your-website-online-ffb8bd3469fa?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffb8bd3469fa</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Wed, 30 Apr 2025 07:28:21 GMT</pubDate>
            <atom:updated>2025-04-30T07:28:21.492Z</atom:updated>
            <content:encoded><![CDATA[<p>When you host your website, you use space on a server to store all of the content, files, and data. Servers are computers that store and send data to website users. Website hosting providers give you space on their servers, making the process easier if you don’t want to use your own server or don’t know how.</p><p>Servers can be physical (hardware you own or rent) or virtual (software-based, running on physical machines). They respond to requests made by browsers and return the correct responses, like showing a homepage, processing a form, or playing a video.</p><h3>What is a server</h3><p>A server is a powerful computer designed to store, process, and deliver web pages to users across the internet.Unlike your personal laptops or phone ,servers run 24/7 and are optimized to handle many request at once .When someone types a website address into their browser,a server sends the necessary files — like HTML, CSS images,and script-to that user’s device.</p><h3>What Is Web Hosting and Its Types</h3><p><strong>Shared Hosting:</strong></p><p>The most common and affordable option, where multiple websites share the same server resources. It’s ideal for beginners with small, low-traffic websites.</p><p><strong>VPS (Virtual Private Server) Hosting:</strong></p><p>Provides more power and control than shared hosting by allocating a dedicated virtual server within a physical server. It’s a good option for growing websites that need more resources but don’t want the cost of dedicated hosting.</p><p><strong>Dedicated Hosting:</strong></p><p>Offers a dedicated physical server for a single website, providing the highest level of control and resources. It’s suitable for large websites with high traffic and demanding needs.</p><p><strong>Free Web Hosting:</strong></p><p>A no-cost option with basic features, suitable for small, beginner projects.</p><p><strong>Cloud Hosting:</strong></p><p>Utilizes multiple servers to ensure greater reliability, scalability, and flexibility. It’s ideal for medium to large-scale websites and e-commerce stores that need to handle fluctuating traffic.</p><p><strong>Reseller Hosting:</strong></p><p>Allows individuals or businesses to resell hosting services to others</p><h3>Comparing Hosting Types</h3><h4>Shared Hosting</h4><ol><li>Multiple websites share a single server’s resources (CPU, RAM, storage).</li><li>- Affordable&lt;br&gt;- Easy to set up&lt;br&gt;- Maintenance handled by provider</li><li>Limited resources&lt;br&gt;- Performance affected by other sites&lt;br&gt;- Less control</li><li>Small personal sites, blogs, startups with low traffic</li></ol><h4>VPS Hosting</h4><ol><li>Virtualized server where you get dedicated resources within a shared physical server.</li><li>- More control than shared&lt;br&gt;- Scalable&lt;br&gt;- Better performance</li><li>- More expensive than shared&lt;br&gt;- Requires technical knowledge</li><li>Growing businesses, medium-traffic sites, developers needing customization</li></ol><h4>Dedicated Hosting</h4><ol><li>Entire physical server dedicated to one user/website.</li><li>- Full control&lt;br&gt;- High performance&lt;br&gt;- Enhanced security</li><li>Expensive&lt;br&gt;- Requires advanced technical skills</li><li>Large businesses, high-traffic sites, e-commerce with sensitive data</li></ol><h4>Cloud Hosting</h4><ol><li>Uses multiple virtual servers (cloud) to distribute resources, ensuring scalability.</li><li>Highly scalable&lt;br&gt;- Reliable (no single point of failure)&lt;br&gt;- Pay-as-you-go</li><li>Can be costly with high usage&lt;br&gt;- Complex to manage</li><li>Dynamic sites, apps with fluctuating traffic, and businesses needing uptime</li></ol><h4>Managed WordPress</h4><ol><li>Hosting optimized for WordPress, with managed updates, backups, and security.</li><li>WordPress-specific features&lt;br&gt;- Easy for beginners&lt;br&gt;- Enhanced support</li><li>Limited to WordPress&lt;br&gt;- More expensive than shared</li><li>WordPress blogs, businesses, or e-commerce sites wanting hands-off management</li></ol><h3>how the website works</h3><ol><li><strong>User Request</strong>: When you type a website’s URL (e.g., <a href="http://www.example.com/">www.example.com</a>) into your browser or click a link, your browser sends a request to the website’s server.</li><li><strong>Server Response</strong>: The server, which hosts the website’s files (HTML, CSS, JavaScript, images, etc.), processes the request and sends back the necessary data.</li><li><strong>Browser Rendering</strong>: Your browser interprets the received files, renders the webpage (e.g., formatting text, displaying images), and executes any scripts to make the page interactive.</li><li><strong>Interaction</strong>: Websites may include dynamic features (e.g., forms, buttons, or live updates) powered by JavaScript or server-side technologies like PHP, Python, or Node.js.</li><li><strong>Data Exchange</strong>: If the website involves user input (e.g., logging in, submitting a form), data is sent to the server, processed, and a response is returned (e.g., a confirmation or updated page).</li></ol><h3>what happen when someone visit the website</h3><ol><li><strong>URL Entry</strong>: The user types a URL (e.g., <a href="http://www.example.com/">www.example.com</a>) into their browser or clicks a link.</li><li><strong>DNS Lookup</strong>: The browser contacts a Domain Name System (DNS) server to translate the URL into an IP address (e.g., 192.0.2.1) that identifies the website’s server.</li><li><strong>Server Request</strong>: The browser sends an HTTP/HTTPS request to the server at that IP address, asking for the website’s data</li><li><strong>Server Response</strong>: The server processes the request and sends back files (HTML, CSS, JavaScript, images, etc.) needed to display the webpage.</li></ol><h3>important of choose correct server</h3><p>Choosing the right server is crucial for optimak bussiness performanc , reliability ,and security .</p><h3>Final Thoughts</h3><p>Servers are the unsung heroes powering the internet, making your website live, fast, and ready to grow. Whether you’re a beginner or a business going big, picking the right server and hosting is key. Think about your budget, how many visitors you expect, and your tech comfort level. Choose a setup that can scale with your site. A solid server isn’t just tech — it’s the backbone of your online world.</p><h3><strong>References</strong>:</h3><p><a href="https://aws.amazon.com/solutions/case-studies/netflix/">AWS Case Study: Netflix</a></p><p><a href="https://www.bluehost.com/">Bluehost Web Hosting</a></p><p>Cloudflare: How Websites Work</p><p>Personal experience building and hosting a project at UKI Technology School</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffb8bd3469fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Props@ State]]></title>
            <link>https://medium.com/@tharuksika09/props-state-b293c67b2002?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b293c67b2002</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Sat, 26 Apr 2025 07:40:22 GMT</pubDate>
            <atom:updated>2025-04-26T07:40:22.300Z</atom:updated>
            <content:encoded><![CDATA[<h3>Props</h3><ul><li><strong>Definition</strong>: Props are like arguments you pass to a function. They are data sent from a parent component to a child component in React.</li></ul><p><strong>Read-only</strong>: The child component can’t change props.</p><ul><li>Used to customize or configure a component.</li><li>Example: Think of props as a name tag you give to a component to make it unique.</li></ul><p>// Parent component<br>function Parent() {<br> return &lt;Child name=”Alice” /&gt;;<br>}</p><p>// Child component<br>function Child(props) {<br> return &lt;h1&gt;Hello, {props.name}!&lt;/h1&gt;; // Displays “Hello, Alice!”<br>}</p><p>Here, name is a prop passed from Parent to Child.</p><h3><strong>State</strong></h3><ul><li><strong>Definition</strong>: State is like a component’s memory. It holds data that can change over time, and when it changes, the component updates (re-renders).</li><li><strong>Key Points</strong>:</li><li><strong>Mutable</strong>: The component can update its own state.</li><li>Used for interactive features, like counters or form inputs.</li><li>Example: Think of state as a score in a game that updates when you play.</li></ul><p>import { useState } from ‘react’;</p><p>function Counter() {<br> const [count, setCount] = useState(0); // State starts at 0<br> return (<br> &lt;div&gt;<br> &lt;p&gt;Count: {count}&lt;/p&gt;<br> &lt;button onClick={() =&gt; setCount(count + 1)}&gt;Add 1&lt;/button&gt;<br> &lt;/div&gt;<br> );<br>}</p><p>Here, count is the state, and clicking the button updates it.</p><h3>Props vs. State</h3><ul><li><strong>Props</strong>: Data from outside (parent) that doesn’t change. Like a letter you receive.</li></ul><p><strong>State: </strong>Data inside the component that can change. Like a note you can edit.</p><ul><li>A parent’s state can be passed as props to a child.</li></ul><p>function Parent() {<br> const [message, setMessage] = useState(“Hi”);<br> return &lt;Child text={message} /&gt;;<br>}</p><p>function Child(props) {<br> return &lt;p&gt;{props.text}&lt;/p&gt;; // Displays “Hi”<br>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b293c67b2002" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Keyword List]]></title>
            <link>https://medium.com/@tharuksika09/mongodb-keyword-list-d72d61640da4?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d72d61640da4</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 09:08:47 GMT</pubDate>
            <atom:updated>2025-04-14T09:08:47.887Z</atom:updated>
            <content:encoded><![CDATA[<h3>Basic Concepts</h3><p>Database<strong> -</strong>A container for collections, similar to a database in SQL.</p><p>Collection<strong> -</strong>A group of MongoDB documents, like a table in SQL.</p><p>Document <strong>-</strong>A single record in MongoDB, stored as a JSON-like object (BSON).</p><p>BSON <strong>-</strong>Binary JSON — the format MongoDB uses to store data.</p><h3>CURD Operations</h3><p>insertOne() -Insert a single document into collection .</p><p>insertMany() -Insert multiple document at once .</p><p>find() -Retrieves document from a collection (can be filtered).</p><p>findOne() -Retrieves a single document.</p><p>updateOne() -Updates a single document.</p><p>updateMany() -updates multiple documents.</p><p>deleteOne() -Deletes one document.</p><p>deleteMany() -Deletes multiple documents.</p><h3>Query Operators</h3><p>$eq -Equal to</p><p>$ne -Not equal to</p><p>$gt / $gte -Greater than / Greater than or equal to</p><p>$lt / $lte -Less than / Less than or equal to</p><p>$in -Matches values in an array</p><p>$nin -Not in array</p><p>$and , $or , $not -Logical operators for compound queries</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d72d61640da4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Aggregation]]></title>
            <link>https://medium.com/@tharuksika09/mongodb-aggregation-d3e37c8affc9?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3e37c8affc9</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 08:39:57 GMT</pubDate>
            <atom:updated>2025-04-15T03:20:02.465Z</atom:updated>
            <content:encoded><![CDATA[<h3>MongoDB Aggregation</h3><p>MongoDB aggregation is a powerful framework for processing and transforming data within a MongoDB collection. It allows you to perform complex data analysis, transformations, and calculations in a multi-stage pipeline. Instead of fetching large amounts of data to the client-side and then processing it, aggregation allows you to perform these operations directly on the MongoDB server, which is often more efficient.</p><h3>Key Concepts of the Aggregation Pipeline:</h3><p>The core of MongoDB aggregation is the aggregation pipeline. This pipeline consists of one or more stages that process the documents in a sequence. Each stage transforms the documents as they pass through the pipeline.</p><p>Here’s how it works:</p><ol><li><strong>Input:</strong> The pipeline starts with the documents from a specified MongoDB collection.</li><li><strong>Stages:</strong> The documents then pass through a series of stages. Each stage performs a specific operation on the documents.</li><li><strong>Output:</strong> The final stage in the pipeline outputs the processed and transformed documents.</li></ol><h3>Common Aggregation Stages:</h3><p>MongoDB provides a rich set of aggregation stages to perform various operations. Some of the most commonly used stages include:</p><ul><li>:$mach: Filters the documents to include only those that match the specified query. This is similar to the find() method&#39;s query.</li><li>$group: Groups documents based on a specified identifier expression and applies accumulator expressions (e.g., $sum, $avg, $min, $max) to each group. This is similar to the GROUP BY clause in SQL.</li><li>$project: Reshapes the documents by adding new fields, removing existing fields, or renaming fields. This is useful for selecting specific fields or creating computed fields.</li><li>$sort: Reorders the documents in the pipeline based on a specified sort key. This is similar to the sort() method.</li><li>$limit: Limits the number of documents passed to the next stage. This is similar to the limit() method.</li><li>$skip: Skips a specified number of documents passing into the stage. This is similar to the skip() method.</li><li>$unwind: Deconstructs an array field from the input documents to output a document for each element in the array.</li><li>$lookup: Performs a left outer join to another collection in the same database to filter in documents from the &quot;foreign&quot; collection for processing.</li><li>$out: Writes the resulting documents of the aggregation pipeline to a specified collection.</li><li>$merge: Writes the resulting documents of the aggregation pipeline to a specified collection. (MongoDB 4.2+) Unlike $out, $merge can insert new documents, merge with existing documents, replace existing documents, keep existing documents, or fail the operation if there&#39;s a conflict.</li><li>$count: Returns a count of the number of documents at this stage of the pipeline.</li><li>$addFields: Adds new fields to documents. Similar to $project but makes it easier to add without having to specify all existing fields.</li><li>$set: Adds new fields or updates existing fields in documents. (MongoDB 4.2+)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3e37c8affc9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Index]]></title>
            <link>https://medium.com/@tharuksika09/mongodb-index-dbf5d438866e?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbf5d438866e</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 07:53:15 GMT</pubDate>
            <atom:updated>2025-04-14T07:53:15.433Z</atom:updated>
            <content:encoded><![CDATA[<p>A good indexing strategy is crucial to ensuring that your MongoDB database returns your results in the most efficient way possible. To build a solid strategy, you need to consider factors like database schema, usage patterns, and database server configuration.</p><p>In this article, you will learn what database indexes are, how to use them in MongoDB, and how to leverage the MongoDB Atlas Performance Advisor to optimize your queries.</p><p>A database index is a special data structure that provides faster access to data and helps create highly performant applications. An index usually consists of two columns: the search key and the data pointer. The key stores the value you want to search for and the pointer points to the block where the data resides. Let’s say you have an index on the ‘score’ field (column) of a collection (table) named ‘exam’. When you want to access the scores that are &lt; 40, the index will scan through blocks rather than individual documents (rows).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbf5d438866e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OBJECT ID]]></title>
            <link>https://medium.com/@tharuksika09/object-id-8968143c85e1?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8968143c85e1</guid>
            <category><![CDATA[objectid]]></category>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 07:46:34 GMT</pubDate>
            <atom:updated>2025-04-13T07:46:34.419Z</atom:updated>
            <content:encoded><![CDATA[<p>An Object Identifier is a name used to identify an object. This object can be a country or an individual disk drive.</p><p>The system object identifier is a MIB value that provides the vendor’s authoritative identification of the network management subsystem contained in the entity and serves as easy and unambiguous means for determining the type of device. You can convert the system object identifier</p><p>Object ID is the international standard for describing cultural objects, to facilitate their identification in case of theft.</p><h4>The Object ID standard defines nine categories of information as well as four steps to fulfil the procedure. The categories are:</h4><ul><li>Type of object</li><li>Materials and techniques</li><li>Measurement</li><li>Inscriptions and markings</li><li>distinguishing features</li><li>Title</li><li>Subject</li><li>Date or period</li><li>Maker</li></ul><p>The four steps are divided as follows:</p><ul><li>Taking photographs of the object</li><li>Identifying the above mentioned categories</li><li>Writing a short description, including additional information</li><li>Keeping the constituted documentation in a secure place</li></ul><p>Amongst the participants promoting and using the Object ID Checklist are:</p><ul><li><a href="https://www.met.police.uk/">Art and Antiques Unit, Metropolitan Police, London</a></li><li><a href="http://www.carabinieri.it/multilingua/en/english/carabinieri-for-the-protection-of-cultural-heritage-and-anti-counterfeiting">Carabinieri Command for Cultural Heritage Protection (TPC), Italy</a></li><li><a href="https://ec.europa.eu/culture/cultural-heritage/cultural-heritage-eu-policies/protection-against-illicit-trafficking">European Commission</a></li><li><a href="https://www.interpol.int/en/Crimes/Cultural-heritage-crime/Object-ID">Interpol</a></li><li><a href="https://www.getty.edu/">J. Paul Getty Trust, Los Angeles</a></li><li><a href="https://www.tropenmuseum.nl/en">National Museum of World Cultures Foundation (NMVW), the Netherlands</a></li><li><a href="https://en.unesco.org/fighttrafficking">UNESCO</a></li><li><a href="http://www.wcoomd.org/en/topics/enforcement-and-compliance/activities-and-programmes/cultural-heritage-programme.aspx">World Customs Organization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8968143c85e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB]]></title>
            <link>https://medium.com/@tharuksika09/mongodb-8a5d73aaf2bf?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a5d73aaf2bf</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 01:16:53 GMT</pubDate>
            <atom:updated>2025-04-13T01:16:53.905Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast-paced development world, flexibility is key — and that’s exactly what MongoDB offers. Unlike traditional relational databases, MongoDB is a NoSQL document-based database. It stores data in BSON (Binary JSON) format, allowing developers to work with data structures that mirror how modern applications handle data.</p><p>One of its standout features is its schema-less design. You don’t need to define tables or fields upfront. This is a huge win for agile teams, enabling faster prototyping and iteration. If your app’s data structure changes often, MongoDB adjusts without painful migrations.</p><p>Scalability is another major plus. MongoDB supports horizontal scaling through sharding, which means you can handle huge volumes of data by distributing it across multiple servers. This is ideal for cloud-based, high-traffic applications.</p><p>It also has a powerful aggregation framework. Whether you need complex data analytics or real-time reporting, MongoDB makes it easy to group, filter, and transform your data using pipeline operators.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a5d73aaf2bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Database question]]></title>
            <link>https://medium.com/@tharuksika09/database-question-d3cf1cb0abb0?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3cf1cb0abb0</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 10:04:41 GMT</pubDate>
            <atom:updated>2025-04-07T10:04:41.302Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Data</h3><p>data is the collection of information gather by observation measurements research or analysis</p><h3><strong>What is a database</strong></h3><p>database is an organized collection of structured data typically store electronically in a computer system</p><h3><strong>What is a Server</strong></h3><p>A server is a computer that provides services or resources to other computers, called clients, over a network.</p><h3><strong>Explain the type of Databases</strong></h3><ol><li>Relational Database</li></ol><p>Data Structure</p><p>E-g:-MySQL , PostgreSQL, Oracle</p><p>2. Non-relational Database</p><p>Data Structure</p><p>E-g:- MongoDB, Redis, Cassandra</p><p>3. Object-Oriented Database</p><p>E-g:- ObjectDB, db4o</p><p>4. Hierarchical Database</p><p>E-g:- : IBM’s Information Management System (IMS)</p><h3><strong>Advantages and Disadvantages of Centralized Database</strong></h3><p>ADVANTAGES:-easier management , data consistency , and simplified backups</p><p>Disadvantages:- Single Point of Failure , limited scalability , network dependency</p><h3><strong>What is the Data controller language and Transaction controller language</strong></h3><p>A data control language (DCL) is a syntax slimier to a computer programming language used to control access to data stored in a database</p><h3><strong>What is DBMS</strong></h3><p>software that allows user to create ,manage ,and interact with database ,enabling , organizations to store ,organize ,and retrieve data efficiently</p><h3><strong>What is the main difference between relational databases (RDBMS) and non-relational databases (NoSQL) in terms of how they store data</strong></h3><p>RDBMS = Structured, table-based data with relationships</p><p>NoSQL = Flexible, schema-less data in various formats</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3cf1cb0abb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DOM Traversal]]></title>
            <link>https://medium.com/@tharuksika09/dom-traversal-1a9232b638b1?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a9232b638b1</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 08:44:12 GMT</pubDate>
            <atom:updated>2025-04-03T08:44:12.541Z</atom:updated>
            <content:encoded><![CDATA[<p>DOM traversal is the process of navigating through the elements of a webpage using JavaScript. It allows you to move between parent, child, and sibling elements dynamically.</p><p>To access a parent element, use parentNode, which returns the direct parent of an element. If you need to find the nearest ancestor that matches a selector, use closest(selector).</p><p>To work with child elements, use children, which returns all direct child elements of a node. If you need only the first or last child, firstElementChild and lastElementChild are useful.</p><p>When navigating between sibling elements, previousElementSibling moves to the previous element, while nextElementSibling moves to the next one.</p><p>For selecting multiple descendant elements, querySelectorAll(selector) returns a list of elements matching the given selector, and getElementsByTagName(tag) retrieves all elements of a specific tag within a node.</p><p>The closest(selector) method is useful when you need to find the nearest ancestor that matches a given selector, including the element itself.</p><p>Using these methods, you can efficiently traverse and manipulate the DOM, making your scripts more dynamic and interactive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a9232b638b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Document Object Model (DOM)]]></title>
            <link>https://medium.com/@tharuksika09/document-object-model-dom-caeee20a8f94?source=rss-48c12fe8e21e------2</link>
            <guid isPermaLink="false">https://medium.com/p/caeee20a8f94</guid>
            <dc:creator><![CDATA[Thara]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 05:23:21 GMT</pubDate>
            <atom:updated>2025-03-20T05:23:21.704Z</atom:updated>
            <content:encoded><![CDATA[<p>The Document Object Model (DOM) is a programming API for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.</p><h3>Key Concepts of the DOM:</h3><ol><li><strong>Tree Structure:</strong> The DOM represents an HTML or XML document as a tree of nodes, where each node corresponds to a part of the document (like elements, attributes, or text).</li><li><strong>Nodes:</strong> The DOM tree consists of different types of nodes, such as:</li></ol><ul><li><strong>Element Nodes:</strong> Represent HTML elements (&lt;div &gt;,&lt;p&gt;)</li><li><strong>Attribute Nodes:</strong> Represent the attributes of elements (e.g.,&lt;class ,&lt;ID&gt;)</li><li><strong>Text Nodes:</strong> Represent the text within elements.</li><li><strong>Document Node:</strong> Represents the entire document.</li></ul><ol><li><strong>Accessing the DOM:</strong> You can access and manipulate the DOM using methods and properties provided by the document object in JavaScript. For example:</li></ol><ul><li>document.getElementById(“my Element”) to access an element by its</li><li>document.querySelector(“.myClass”) to select an element by a CSS selector.</li></ul><ol><li><strong>Manipulating the DOM:</strong> You can change the content, style, or structure of the webpage using methods like:</li></ol><ul><li>element.textContent or element.innerHTML to change the</li><li>element.style to modify styles.</li><li>element.appendChild(NewElement) to add a new</li></ul><ol><li><strong>Event Handling:</strong> You can attach event listeners to elements to make the page interactive. For example:</li></ol><ul><li>document.getElementById(btn).addEventListener(“click, function(){allert (button clicker!); });</li></ul><p><strong>How the DOM works</strong></p><ul><li>The DOM represents a document as a tree-like structure of nodes, with each node representing part of the document</li><li>The DOM connects web pages to scripts and programming languages</li><li>DOM methods allow programmatic access to the tree, so you can change the document’s structure, style, or content</li><li>You can add event listeners to nodes and trigger them on specific events</li></ul><p><strong>Benefits of the DOM</strong></p><ul><li>Allows for dynamic content updates without reloading the page</li><li>Makes webpages more interactive by responding to button clicks and form submissions</li><li>Provides a standard way for scripts to interact with web documents, ensuring browser compatibility</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caeee20a8f94" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>