...called a consent management platform (CMP). Your website will load this CMP via a JavaScript tag which will then directly render the form. The form will show the user detailed...

...See https://www.consentstringdecoder.com/ for an example string. The CMP will even inject a standardized JavaScript function called __tcfapi into your website. This can be used by any other third-party...

caniuse.com

All major browsers (IE8+, FF3.5+, Safari 4+, any Chrome) support sessionStorage, a JavaScript storage object that survives page reloads and browser restores, but is different per new tab/window (in contrast...

makandra dev

...from the toolbar. For that, you should listen to the trix-initialize event in javascript. addEventListener("trix-initialize", event => { const { toolbarElement } = event.target const textTools = toolbarElement.querySelector("[data-trix-button-group=text...

testing-library are widely used testing utilities libraries for javascript dependent frontend testing. The main utilities provided are query methods, user interactions, dom expectations and interacting with components of several...

...have many elements on our page. Clicking them should open a modal dialog. Vanilla JavaScript document.addEventListener('click', function(event) { if (event.target.closest('.dialog-link')) { // Open dialog } }); See Event delegation without jQuery...

...local development where you might still use http://. If you set any cookies from JavaScript, this isn't fixed by the middleware. Add this to lib/middleware/secure_cookies.rb: # On HTTPS requests, we...

...single-line texts. If you want to truncate tests across multiple lines, use a JavaScript solution like Superclamp. There is also -webkit-line-clamp which works only on Chrome.

...know about this. 0. Security considerations Each "like" button is implemented by including a Javascript on your site. This means you are running fucking remote code on your page. You...

...site is suggesting security by operating under HTTPS and you are still loading remote Javascript you are sort of full of shit. Even if you are cool with injecting remote...

...is never reached. Note that this is not quite the same as "hoisting" in JavaScript. The variable is not available in the whole block, just in lines after its declaration...

open-ui.org

...in web applications e.g. selects. It would require only a minimum of CSS and Javascript to get them working and looking good. The purpose of the Open UI, a W3C...

...be able to click and drag to scroll), or resort to some kind of JavaScript solution...

...CoffeeScript to ES6. You can use decaffeinate to convert your CoffeeScript source to modern JavaScript. Install decaffeinate globally: npm install -g decaffeinate Call decaffeinate on each .coffee file, relaxing some...

Plot graphs in Ruby WebGraphviz renders in your browser via JavaScript (to store the rendered graph, extract the SVG using your browser's DOM inspector) GraphViz with DOT: Online...

...icon font (plus stylesheets), but recently it can also be used as a pure JavaScript solution (which will render icons as inline tags), or even as SVG sprites.

...have their pros and cons: Icon font: little CPU load (no JavaScript) fonts are relatively large 1 extra HTTP request Javascript + inline SVG: higher CPU load (needs to watch the...

makandra dev

...if it closes the tab entirely. It will not be dispatched when navigating via JavaScript. In this case you need to listen to other events. Quirks The "default behavior" in...

making the whole page position: sticky; left: 0 capturing the scroll position with JavaScript and turning it into a transform: translateX on the table itself. Note that the table...

...the GA snippet into more than one website, maybe you've even used its Javascript API to implement tracking at the event level. Google Tag Manager (GTM) is a related...

...GTM (which makes GTM a huge XSS machine, actually). This goes even beyond injecting Javascript snippets and tracking page views. Even event tracking can be modeled inside GTM, using a...

github.com

...add -p with single key presses Stash unstaged changes only with git stash -k JavaScript Create an object with no properties with Object.create(null) => {} The comma operator returns its last...

...toBe passes when first === second. Unfortunately this is useless for non-primitive values because JavaScript is a horrible language. However, Jasmine comes with another matcher toEqual: expect(first).toEqual(second...

...This is the same as finding an option with the { selected: true } property in JavaScript: select.querySelectorAll('option').find((option) => option.selected) What about the selected attribute? Note that option[selected] would...

...not once the user switched to a different value. It also won't work in JavaScript-heavy applications where you might not be rendering an option tag with the selected...

...Add a new link to your browser's bookmarks bar with the following URL. javascript:(() => { if (document.querySelector('[data-view-id="issue-view"]')) { const [id, ...words] = document.title.split(' ') ; prompt('Commit message:', `[${id...

...properly, with modern CSS features In the past, you might have resorted to bulky JavaScript solutions or CSS hacks like transitioning between max-height: 0 and max-height: 9999px. All...

Browsers blocks abusable JavaScript API calls until the user has interacted with the document. Examples would be opening new tab or start playing video or audio. E.g. if you attempt...

...an element, click on it, and remove the element again. This unblocks the entire JavaScript API for the current page. You can include the following module in your test to...

...a monkey-patch for Capybara::Node::Element#click that will use the Element#scrollIntoViewIfNeeded JavaScript function before clicking any element: Capybara::Node::Element.prepend(Module.new do def click(*keys, **options)