Skip to content
Advertisement

Tag: javascript

Capture key press without placing an input element on the page?

How to capture key press, e.g., Ctrl+Z, without placing an input element on the page in JavaScript? Seems that in IE, keypress and keyup events can only be bound to input elements (input boxes, textareas, etc) Answer jQuery also has an excellent implementation that’s incredibly easy to use. Here’s how you could implement this functionality across browsers: Tested in IE7,Firefox

PHP Redirection with Post Parameters

I have a webpage. This webpage redirects the user to another webpage, more or less the following way: Well, you see, what I do is transferring the GET params into POST params. Do not tell me it is bad, I know that myself, and it is not exactly what I really do, what is important is that I collect data

How can I convert a comma-separated string to an array?

I have a comma-separated string that I want to convert into an array, so I can loop through it. Is there anything built-in to do this? For example, I have this string Now I want to split this by the comma, and then store it in an array. Answer MDN reference, mostly helpful for the possibly unexpected behavior of the

Align div with fixed position on the right side

I want to show a div which is always visible even as the user scrolls the page. I have used the CSS position: fixed; for that. Now I also want to show the div at the right hand corner of the parent div. I tried to use this CSS code to achieve the goal: But it doesn’t align the element

Advertisement