<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>
Archive for June 16th, 2008
Javascript: addEventListener and attachEvent
Monday, June 16th, 2008RSS Example
Monday, 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>