Advanced Search

View RSS Feed

All Blog Entries

  1. Show plain text in a password field

    I was browsing the internet and came across this tecnique and thought it was rather cool.

    To make plain text show in a password field, you need the following form -

    HTML Code:
     <form>
     <input type="text" name="passwordPlain" id="passwordPlain" value="Password" onfocus="swapPasswordBoxes('click')" style="display:none;"/>
     <input type="password" name="password" id="password"
    ...

    Updated 06-08-2012 at 10:23 PM by keyboard (swapped onclick for onfocus)

    Categories
    Post a JavaScript
  2. Force a page to open in a new tab

    There's an increasing number of sites that refuse to be opened in a new window. For instance, the following doesn't work (anymore):
    Code:
    <a href="javascript: void(0)" onclick="window.open('http://google.com'">open Google in new (traditional) window</a>
    In those cases, you can use the following to open the sites in a new tab:
    Code:
    <a href="javascript: void(0)" onclick="window.open('','_new').location.href='http://google.com'">open
    ...
    Categories
    Post a JavaScript
  3. Version 5 Events

    In javascript there are basically two types of events that can be assigned to elements and objects. I classify them as version 4 events (those that were available in Netscape 4 and IE 4), and version 5 events, those that became available starting with IE 5 and presumably NS 5, but the earliest I'm aware of them in NS was NS 6 (I don't recall ever seeing a NS 5 browser).

    Version 4 events are still available in today's browsers and are usually the first ones folks learn about, examples: ...

    Updated 04-05-2012 at 05:26 AM by jscheuer1 (add info)

    Categories
    JavaScript & Ajax
  4. document.getElementById shortcut

    I'm amazed at how many people don't use a very simple shortcut for document.getElementById. This is for all the people who don't use a javascript library like jQuery.

    All you have to do is include this code somewhere on your page

    Code:
    function $(element) {
    return document.getElementById(element);
    }
    Then when you want to use document.getElementById('id'); just type $('id'); instead.

    Example

    Code:
    <html>
    ...
    Categories
    JavaScript & Ajax
  5. Forcing YouTube to play videos in a specific quality

    I was having troubles the other day loading a YouTube-video (using Firefox). The URL:
    http://www.youtube.com/v/W13GifsFFfk?version=3
    (this url may work on your machine, but it doesn't on mine (when I use Firefox)).

    My guess was that the problem was caused by the video's HD-quality. So I googled around to see how we can force YouTube to play videos in a specific quality. I found that we can do it by appending the following to the YouTube-url:
    &amp;vq=small ...
    Categories
    Uncategorized
Page 5 of 16 FirstFirst ... 3456715 ... LastLast