RSS feed [root] /script /web /weblog




login:

password:

title search:




 


Wed Sep 07 04:19:14 GMT 2005

library to prevent embed javascript in html



Instead of:

<li>
<a onclick="this.parentNode.removeChild(this)" href="#">Click me to delete me</a>
</li>

Your markup remains:

<ul id="example">
<li>
>a href="/someurl">Click me to delete me
</li>
</ul>

Then, in a separate script, you can provide the behavior using CSS selectors.

var myrules = {
'#example li' : function(el) {
el.onclick = function() {
this.parentNode.removeChild(this);
}
}
};

Behaviour.register(myrules);

http://www.firelord.net/modifiedbehavior


(google search) (amazon search)
second
download zip of files only