<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: listener code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Mon, 06 Oct 2008 12:08:32 GMT</pubDate>
    <description>DZone Snippets: listener code</description>
    <item>
      <title>Javascript Window OnLoad Listener</title>
      <link>http://snippets.dzone.com/posts/show/3282</link>
      <description>This script gives the ability to run javascript functions after the page has loaded.  I definitely can't take credit for this, as it's one I found, but I use it constantly.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;window.onloadListeners=new Array();&lt;br /&gt;&lt;br /&gt;window.addOnLoadListener = function (listener) {&lt;br /&gt;	window.onloadListeners[window.onloadListeners.length]=listener;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;window.onload=function(){&lt;br /&gt;	for(var i=0;i&lt;window.onloadListeners.length;i++){&lt;br /&gt;		func = window.onloadListeners[i];&lt;br /&gt;		func.call();&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//window.addOnLoadListener(function);&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 14 Jan 2007 12:19:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3282</guid>
      <author>bgidge (Bryan Gidge)</author>
    </item>
  </channel>
</rss>
