RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • Contact Us
  • deviantART
  • Newsletter
  • Online Booking
  • Registration
  • Tell A Friend
  •  

    Javascript: addEventListener and attachEvent

    June 16th, 2008


    <script type=”text/javascript”>
    function addListener(el, act, func) {
    if (window.addEventListener) {el.addEventListener(act,func,false);}
    else if (window.attachEvent) {el.attachEvent (”on”+act,func);}
    else { eval(”el.on”+act+” = func;”);}
    }
    function documentOnLoad() { alert(123); }
    addListener(window, “load”, documentOnLoad);
    </script>


    RSS Example

    June 16th, 2008

    <?php
    header(’Content-Type: text/xml; charset=UTF-8′, true);
    ?>
    <?php echo ‘<?xml version=”1.0″ encoding=”UTF-8″?’.'>’; ?>
    <rss version=”0.92″>
    <channel>
    <title><?=$channel_title?></title>
    <link><?=”http://”.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])?></link>
    <description><?=$channel_description?></description>
    <lastBuildDate><?php echo date(’D, d M Y H:i:s +0000′); ?></lastBuildDate>
    <docs>http://backend.userland.com/rss092</docs>
    <language>id</language>

    <?php
    // begin loop
    ?>
    <item>
    <title><?=$the_title_rss?></title>
    <description><?=$the_content_rss?></description>
    <link><?=$the_permalink_rss?></link>
    </item>
    <?php
    // end loop
    ?>
    </channel>
    </rss>


    Rudy Cahayadi is Digg proof thanks to caching by WP Super Cache!