...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...

...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.

...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...

...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...

...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...

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...

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...

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...

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...

...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...

...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...

...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...

...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...

...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)

makandra dev

...Basic HTML example # Javascript API (notable methods and properties) video = document.querySelector('video') video.play() video.pause() video.load() // Reset to the beginning and select the best available source video.currentSrc // The selected source video.currentTime...

...Web and native playback overview (April 2020) Full Documentation on the video element Attributes Javascript events

Limitations The helper cannot inspect downloads that are triggered or created by JavaScript. The helper cannot inspect downloads from a different hostname than that of the application.

...application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript or integrate a CoffeeScript compiler to your new process. This checklist can be used to...

...except that it returns all types of child nodes) Filter manually using either plain Javascript or jQuery's filter() method Example Let's write a function that takes a jQuery...

If you use Cucumber for integration testing, wrap that into something like Before('@javascript') {...

Benefits of using device metrics are: You can configure any device resultion and are not...

...explained in this card. It will prevent attackers from reading your cookies by malicious Javascript and prevent the user's browser from sending it over insecure HTTP connections. Generally: prefer...

...how to do it without a server-side component (like a Rails application). Use JavaScript's navigator.language (real browsers and IE11+) and navigator.userLanguage (old IEs). Use a refresh as fallback...

...Provide buttons for paranoid users that disabled JavaScript and meta refreshs. JavaScript The following JavaScript will try to auto-detect a user's preferred language. It understands strings like like...