What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-23 18:20:08
angular agm
Step 1: Creating new project Create a new project using command ng new gmaps-ng5 Step 2: Install Google Maps types for typescript support. Run command npm install --save @types/googlemaps Step 3: Link Google Maps JavaScript CDN inside index.html <scrip... Add solution -
Html 2021-10-21 16:00:10
prevent user from typing e,+,- from number input
var inputBox = document.getElementById("inputBox"); var invalidChars = [ "-", "+", "e", ]; inputBox.addEventListener("keydown", function(e) { if (invalidChars.includes(e.key)) { e.preventDefa... Add solution -
Javascript 2021-10-18 20:46:03
jquery onclick button post
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(function() { $('#submi... Add solution -
Javascript 2021-10-17 05:02:05
how does URL.createObjectURl differ from fileReader
const fileSelect = document.getElementById("fileSelect"), fileElem = document.getElementById("fileElem"), fileList = document.getElementById("fileList"); fileSelect.addEventListener("click", function (e) { ... Add solution -
Javascript 2021-10-14 05:01:06
updating one state of an object of states react useState
function LoginForm() { const [form, setState] = useState({ username: '', password: '' }); const printValues = e => { e.preventDefault(); console.log(form.username, form.password); }; const updateField = e => { setStat... Add solution -
Javascript 2021-10-12 05:23:07
javascript trap focus
/** *Function should be called on keyPress or something */ function _focusTrapperEvent(e) { if (!(e.key === 'Tab' || e.keyCode === 9)) return; let condition = 'a[href], area[href], input:not([disabled]):not([type="hidden"]), select:not([... Add solution -
Other 2021-10-11 05:29:06
Why is #_=_ appended to the redirect URI? passport facebook
$(window).on('load', function(e){ if (window.location.hash == '#_=_') { window.location.hash = ''; // for older browsers, leaves a # behind history.pushState('', document.title, window.location.pathname); // nice and clean e.preventDefault()... Add solution