javascript

How to Validate an Email Address in JavaScript

In this short tip post, we will learn how to validate an email address in JavaScript using Regular expressions. Objective Validate the input email address using Regular expression in plain JavaScript. Approach Email addresses are consists of two parts: Local part Domain part Local part can be a combination of strings, numbers and alphanumeric and …

How to Validate an Email Address in JavaScript Read More »

How to Encode and Decode a URL Using JavaScript

In this short tip post, we will learn how to encode a URL using JavaScript native function. Encoding a URL is a very important security aspect. Objective To encode and decode the given URL address. Approach We can use JavaScript native encodeURI() and encodeURIComponent() function to encode the URL’s. encodeURI() cannot encode the ~!@#$&*()=:/,;?+ characters. …

How to Encode and Decode a URL Using JavaScript Read More »