<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - noah</title>
<link>http://snipplr.com/users/noah/tags/DOM</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sun, 07 Sep 2008 00:49:09 GMT</pubDate>
<item>
<title>(Ruby) Rendered WGet with Selenium</title>
<link>http://snipplr.com/view/7906/rendered-wget-with-selenium/</link>
<description><![CDATA[ <p>Created in response to a discussion about "ghosting," between Kord Campbell of Splunk and Christian Heilman of Yahoo! at Ajax World 2008.

IMPORTANT: The Selenium-RC server must be running on port 4444 (the default) and you must have Curl and Tidy installed on your system.   

NOTE: Diffing the rendered versus the "server" source.  This option works OK as a learning tool, but I need to do more in terms of normalizing the server source versus the rendered source.  I run both the "server" and innerHTML sources through Tidy, but unfortunately there still seems to be a lot of extraneous differences between them.

So while this works OK for downloading the rendered source via a Ruby script, I've got a ways to go before it can produce a reliable "rendered diff."</p> ]]></description>
<pubDate>Mon, 18 Aug 2008 09:23:43 GMT</pubDate>
<guid>http://snipplr.com/view/7906/rendered-wget-with-selenium/</guid>
</item>
<item>
<title>(JavaScript) List all class names used in a DOM tree</title>
<link>http://snipplr.com/view/6488/list-all-class-names-used-in-a-dom-tree/</link>
<description><![CDATA[ <p>Lists each CSS class name that is applied to an element within an HTML page.

Some applications suggested by this pattern are:
- List class names by frequency of use.
- List class names by what kind of element they are applied to.
- List class names that are only used once.</p> ]]></description>
<pubDate>Wed, 28 May 2008 17:31:41 GMT</pubDate>
<guid>http://snipplr.com/view/6488/list-all-class-names-used-in-a-dom-tree/</guid>
</item>
<item>
<title>(JavaScript) Find Verbose IDs in the DOM</title>
<link>http://snipplr.com/view/6474/find-verbose-ids-in-the-dom/</link>
<description><![CDATA[ <p>Traverses the DOM tree and reports if any IDs are over 30 characters in length.  Doesn't check for doubled IDs because that's caught when validationg the HTML.</p> ]]></description>
<pubDate>Tue, 27 May 2008 17:08:12 GMT</pubDate>
<guid>http://snipplr.com/view/6474/find-verbose-ids-in-the-dom/</guid>
</item>
<item>
<title>(JavaScript) find ancestor</title>
<link>http://snipplr.com/view/3339/find-ancestor/</link>
<description><![CDATA[ <p>find the first ancestor on which comparisonFunc evaluates to true
works the same way as a custom sort
the el specified in the pram will be the FIRST el to which comparisonFunc is applied.

this is, this function considers me to be my own first ancestor :)</p> ]]></description>
<pubDate>Fri, 20 Jul 2007 19:26:22 GMT</pubDate>
<guid>http://snipplr.com/view/3339/find-ancestor/</guid>
</item>
<item>
<title>(JavaScript) toggle classname</title>
<link>http://snipplr.com/view/3338/toggle-classname/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 20 Jul 2007 19:15:59 GMT</pubDate>
<guid>http://snipplr.com/view/3338/toggle-classname/</guid>
</item>
<item>
<title>(JavaScript) Kruse's hasClass</title>
<link>http://snipplr.com/view/3337/kruses-hasclass/</link>
<description><![CDATA[ <p>This Matt Kruse's hasClass function.</p> ]]></description>
<pubDate>Fri, 20 Jul 2007 19:06:22 GMT</pubDate>
<guid>http://snipplr.com/view/3337/kruses-hasclass/</guid>
</item>
<item>
<title>(JavaScript) click on an element across browsers</title>
<link>http://snipplr.com/view/3336/click-on-an-element-across-browsers/</link>
<description><![CDATA[ <p>If you have assigned an event handler to a container, you might want to remotely trigger it as if a child of the container had been clicked.  That is, you might want to manually set the target of the 'event' object that is passed to the event handler on the container.  This helps to keep the number of event handlers down.</p> ]]></description>
<pubDate>Fri, 20 Jul 2007 18:08:37 GMT</pubDate>
<guid>http://snipplr.com/view/3336/click-on-an-element-across-browsers/</guid>
</item>
<item>
<title>(JavaScript) Create new CSS Selector (FF, IE, Opera)</title>
<link>http://snipplr.com/view/3333/create-new-css-selector-ff-ie-opera/</link>
<description><![CDATA[ <p>Construct and add a selector to an existing stylesheet.  Does not work in Safari.</p> ]]></description>
<pubDate>Fri, 20 Jul 2007 10:53:32 GMT</pubDate>
<guid>http://snipplr.com/view/3333/create-new-css-selector-ff-ie-opera/</guid>
</item>
<item>
<title>(JavaScript) Find doubled IDs in the DOM</title>
<link>http://snipplr.com/view/3303/find-doubled-ids-in-the-dom/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 14 Jul 2007 14:51:33 GMT</pubDate>
<guid>http://snipplr.com/view/3303/find-doubled-ids-in-the-dom/</guid>
</item>
<item>
<title>(JavaScript) set a nested DOM property with square bracket notation</title>
<link>http://snipplr.com/view/3263/set-a-nested-dom-property-with-square-bracket-notation/</link>
<description><![CDATA[ <p>This was fun to write.  I wonder if nested DOM properties can be set with any of JavaScript's built-in methods?</p> ]]></description>
<pubDate>Tue, 10 Jul 2007 10:05:48 GMT</pubDate>
<guid>http://snipplr.com/view/3263/set-a-nested-dom-property-with-square-bracket-notation/</guid>
</item>
<item>
<title>(JavaScript) Safely Get and Operate Upon An Element</title>
<link>http://snipplr.com/view/3071/safely-get-and-operate-upon-an-element/</link>
<description><![CDATA[ <p>Pass this an ID or an object reference, as well as any number of functions that take the referenced object as a parameter.  This wrapper is intended to provide a sanity check against missing DOM elements.</p> ]]></description>
<pubDate>Thu, 28 Jun 2007 20:09:25 GMT</pubDate>
<guid>http://snipplr.com/view/3071/safely-get-and-operate-upon-an-element/</guid>
</item>
<item>
<title>(JavaScript) Get Mouse Position (from Quirksmode.org)</title>
<link>http://snipplr.com/view/3032/get-mouse-position-from-quirksmodeorg/</link>
<description><![CDATA[ <p>This is PPK's solution for finding mouse position across platforms.</p> ]]></description>
<pubDate>Mon, 25 Jun 2007 08:36:02 GMT</pubDate>
<guid>http://snipplr.com/view/3032/get-mouse-position-from-quirksmodeorg/</guid>
</item>
<item>
<title>(JavaScript) accept either an element or an id as a parameter</title>
<link>http://snipplr.com/view/2849/accept-either-an-element-or-an-id-as-a-parameter/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Tue, 12 Jun 2007 07:42:21 GMT</pubDate>
<guid>http://snipplr.com/view/2849/accept-either-an-element-or-an-id-as-a-parameter/</guid>
</item>
<item>
<title>(JavaScript) Change opacity in all browsers</title>
<link>http://snipplr.com/view/2844/change-opacity-in-all-browsers/</link>
<description><![CDATA[ <p>Check whether style.opacity is available.  If not, then apply IE proprietary opacity</p> ]]></description>
<pubDate>Mon, 11 Jun 2007 12:07:17 GMT</pubDate>
<guid>http://snipplr.com/view/2844/change-opacity-in-all-browsers/</guid>
</item>
<item>
<title>(JavaScript) Set IE Hover State</title>
<link>http://snipplr.com/view/2842/set-ie-hover-state/</link>
<description><![CDATA[ <p>assigns/removes the class 'over' to elements on hover since IE does not attach :hover to any element but A</p> ]]></description>
<pubDate>Mon, 11 Jun 2007 09:09:44 GMT</pubDate>
<guid>http://snipplr.com/view/2842/set-ie-hover-state/</guid>
</item>
<item>
<title>(JavaScript) Stop event propagation (stop an event from bubbling up)</title>
<link>http://snipplr.com/view/2810/stop-event-propagation-stop-an-event-from-bubbling-up/</link>
<description><![CDATA[ <p>This is useful if I have an element that is inside a container, and I want to the element's event handler to fire without triggering the container's event handler.  Then I would wrap the element's event handler function with this code.

See "PPK On JavaScript," pp. 315 and 323.</p> ]]></description>
<pubDate>Wed, 06 Jun 2007 12:09:40 GMT</pubDate>
<guid>http://snipplr.com/view/2810/stop-event-propagation-stop-an-event-from-bubbling-up/</guid>
</item>
<item>
<title>(JavaScript) Get the event object and the element that triggered the event</title>
<link>http://snipplr.com/view/2808/get-the-event-object-and-the-element-that-triggered-the-event/</link>
<description><![CDATA[ <p>See "PPK On JavaScript," p. 323.</p> ]]></description>
<pubDate>Wed, 06 Jun 2007 10:29:53 GMT</pubDate>
<guid>http://snipplr.com/view/2808/get-the-event-object-and-the-element-that-triggered-the-event/</guid>
</item>
<item>
<title>(JavaScript) Accept a parameter that is /either/ a DOM element /or/ the ID of a DOM element.</title>
<link>http://snipplr.com/view/2710/accept-a-parameter-that-is-either-a-dom-element-or-the-id-of-a-dom-element/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 24 May 2007 13:40:48 GMT</pubDate>
<guid>http://snipplr.com/view/2710/accept-a-parameter-that-is-either-a-dom-element-or-the-id-of-a-dom-element/</guid>
</item>
<item>
<title>(JavaScript) Height of window</title>
<link>http://snipplr.com/view/2638/height-of-window/</link>
<description><![CDATA[ <p>Get the height of the browser window in any browser.  Rob Zand's code.</p> ]]></description>
<pubDate>Tue, 15 May 2007 10:29:17 GMT</pubDate>
<guid>http://snipplr.com/view/2638/height-of-window/</guid>
</item>
<item>
<title>(JavaScript) Toggle the className of a DOM element</title>
<link>http://snipplr.com/view/2600/toggle-the-classname-of-a-dom-element/</link>
<description><![CDATA[ <p>Imagine an element that has two states, represented by two CSS classes named 'expanded' and 'contracted.'  This code toggles between the two states.</p> ]]></description>
<pubDate>Fri, 04 May 2007 08:45:52 GMT</pubDate>
<guid>http://snipplr.com/view/2600/toggle-the-classname-of-a-dom-element/</guid>
</item>
</channel>
</rss>