View RSS Feed

JavaScript & Ajax

  1. A Strange Menu-Include

    I was playing around with some code recently and discovered - more or less by accident - that we can include any fully functioning standalone menu by doing the following. The scripts and styles belonging to the external file will be preserved after inclusion:
    1. We put this script just before the closing body-tag of the external file:
    Code:
    <script type="text/javascript">
    try{top.document.getElementById('container_div').innerHTML=document.documentElement.innerHTML}
    ...
    Categories
    JavaScript & Ajax
  2. The YouTube version3 player

    The player used on http://www.youtube.com/watch?v=VIDEO_ID is YouTube's version3 player. If you want to use it directly (without the watch?v= part) you can do, for instance: http://www.youtube.com/v/EUSsXdhxFIM?version=3. (You may have to press CTRL if you want this to work in IE).

    The advantage of the version3-player over other versions is that a click on a playing video doesn't open a new YouTube window containing all sorts of information that you may not be interested in. The click ...

    Updated 11-29-2010 at 02:57 PM by molendijk

    Categories
    JavaScript & Ajax
  3. Sticky Tooltip script Unofficial Update

    The Sticky Tooltip script has some room for updating as I've outlined here:

    Sticky Tooltip script - not sticky

    and here:

    Sticky Tooltip script - no dock in IE 7- for image map

    In those threads I offer piecemeal solutions, the first of which above is the most problematic:

    Quote Originally Posted by jscheuer1 View Post
    Even on the demo page, if the tip is in sticky mode and one mouses over one of the other triggers, the tip changes position and content. Also in sticky mode,
    ...

    Updated 12-16-2010 at 05:17 PM by jscheuer1 (add another update)

    Categories
    DD Scripts Mods , JavaScript & Ajax
  4. Get Style

    Sometimes we want to get the style of something. But, since it wasn't set inline or via javascript, or perhaps was set in a stylesheet using the:

    Code:
    !important
    keyword that overrides inline and javascript assignments, we cannot access it. Here is a fairly robust script that will allow us to do so in many cases:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    ...

    Updated 03-05-2010 at 02:52 AM by jscheuer1 (precision in explanations)

    Categories
    JavaScript & Ajax
  5. Some Remarks about Ajax-includes using document.write

    Some Remarks about Ajax-includes using document.write

    I. Why document.write?
    Including external content with the help of document.write brings in external html AND external code (js, css). This is a clear advantage of document.write over other inclusion-methods, like innerHTML (does not execute scripts) and appendChild (does not automatically import all the external js and/or css when IE, Chrome or Opera are used). To see this, create a file external.html with some js in it, ...

    Updated 02-27-2010 at 07:32 PM by molendijk

    Categories
    JavaScript & Ajax
Page 7 of 9 FirstFirst ... 56789 LastLast