Skip to content

Open Gmail on mailto: action

How to force web-browser to navigate to Gmail and create (if logged in) new letter with filled in field ‘To’ on click on mailto:SomeMail@blabla.example? Answer There’s a Greasemonkey script. The compose URL is: https://mail.google.com/mail/?view=cm&fs=1&to=email@domain.example

How do I create bit array in Javascript?

What is the best way of implementing a bit array in JavaScript? Answer Here’s one I whipped up: UPDATE – something about this class had been bothering me all day – it wasn’t size based – creating a BitArray with N slots/bits was a two step operation – instantiate, resize. U…

Changing the order of the Object keys….

This is a sample object which i am getting from back end, now i want to change the order of the object. I don’t want to sort by name or size… i just want to manually change the order… Answer if you want to manually reorder. simply create new object and assign values using old object.

Sending Javascript Object to PHP via Ajax

I’m learning Ajax by failure and have hit a wall: I have an array (if it matters, the array is storing number id’s based on what checkboxes the user checks) that is written in Javascript. I have a function that is called when the user clicks the ‘save’ button. The function is as follow…

javascript focus() not working on Firefox and IE?

I’m trying to appear a form and focus it, for some reason it only works on Chrome. How can I make it work across browsers? You can see it not working in here: http://jsfiddle.net/CCxrp/1/ What can I do to make it work? Thanks Answer You just need to swap the order of things: The divs have to be in the

Is it possible to chain setTimeout functions in JavaScript?

Is it possible to chain setTimout functions to ensure they run after one another? Answer Three separate approaches listed here: Manually nest setTimeout() callbacks. Use a chainable timer object. Wrap setTimeout() in a promise and chain promises. Manually Nest setTimeout callbacks Of course. When the first on…