How to encode URL in JS?

Small tutorial with code examples about how to encode URL in JavaScript safely
31 October 2017   2093

For example, you have and URL that need to be encoded safely using JavaScript such way such that it can be put into a GET string.

var myUrl = "http://example.com/index.html?param=1&anotherParam=2";
var myOtherUrl = "http://example.com/index.html?url=" + myUrl;

Use the built-in function encodeURIComponent(str) and encodeURI(str)

var myOtherUrl = 
       "http://example.com/index.html?url=" + encodeURIComponent(myUrl);

Bootstrap 3.4.0 to be Out

The project team is focused on developing Bootstrap 4.2, so the current version didn’t get as many changes
17 December 2018   505

Bootstrap 3.4 is out - a free framework for creating websites and web applications. The project team is focused on developing Bootstrap 4.2, so the current version didn’t get many changes. In particular, the documentation has been updated, the problem with the XSS vulnerability has been fixed, and the Algolia search function has been added.

New features in the tool:

  • The developers added a new class .row-no-gutters, the ability to search for documents through Algolia and the addition to .navbar-fixed- * when opening a pop-up notification.
  • An issue with vulnerability to XSS attacks in Alert, Carousel, Collapse, Dropdown, Modal and Tab components has been fixed.
  • The developers have removed the double frame in the <abbr> elements. In addition, they refused to support dragging and dropping from the customizer and creating in the Gist web customizer, since GitHub had long since disabled this feature.

What has changed in the documentation

  • Developers have added a drop-down menu for new and previous versions to the documentation navigation.
  • The library for copying text to the ZeroClipboard clipboard was replaced with clipboard.js, and the testing was transferred to BrowserStack.
  • Reorganized CSS v3 documentation to use Less.
  • baseurl replaced by/docs/3.4/.
  • Updating links will allow you to open them only via HTTPS and fix broken URLs.

A detailed description of all the features of Bootstrap 3.4.0 is available in the official documentation. To upgrade to Bootstrap 3.4.0 using the npm package manager, thenpm i bootstrap @ previous or npm i bootstrap@3.4.0 commands are provided. Upgrading to this version via Bower is not available.