====== Javascript ======
==== Minifiers ====
* [[https://www.toptal.com/developers/javascript-minifier|Online JavaScript Minifier Tool and Compressor]]
* [[https://jscompress.com/|JSCompress]]
* [[https://www.giftofspeed.com/javascript-compressor/|JavaScript Compressor]]
* [[https://www.digitalocean.com/community/tools/minify#top|JavaScript Minify Tool (Digital Ocean)]]
* [[https://www.minifier.org/|Minify JS / CSS]]
==== Find highest z-index on page in browser ====
* If an unexpected element is blocking your screen, you can find the highest z-index value currently in use. Press F12, go to the Console tab, paste this code, and press Enter:const highestZ = Math.max(
...Array.from(document.querySelectorAll('*'))
.map(el => parseFloat(window.getComputedStyle(el).zIndex))
.filter(z => !isNaN(z))
);
console.log('Highest z-index on this page:', highestZ);
* To bypass the warning, type allow pasting directly into the Chrome console and press Enter, then paste your code again.
==== Modify an elements value in an iFrame ====
Remember, cross site access to iFrame properties is not possible (security).
==== Pass POST variable through Javascript ====
myvar = document.createElement('input');
myvar.setAttribute('name', 'somename');
myvar.setAttribute('type', 'hidden');
myvar.setAttribute('value', 'somevalue');
form.appendChild(myvar);
==== iFrames ====
* [[http://stackoverflow.com/questions/13214419/alternatives-to-iframe-srcdoc|Alternatives to iframe srcdoc]]
* [[http://stackoverflow.com/questions/236073/why-split-the-script-tag-when-writing-it-with-document-write|Why split the