Please send any feedback on admin@ajaxline.com.
If you want to share your experience and post article on Ajaxline just e-mail it to us and we publish it.
Walking on JavaScript objects trees. Can we do it with JSON or JavaScript like we can while we work with XML?
Lazy Inheritance is an approach intended to simplify writing OOP and provides support of prototype-based classes hierarhies, automatic resolving and optimizing classes dependencies.
JSINER (originated from JavaScript INheritance supportER) is a lazy inheritance implementation in JavaScript. JSINER page on SoftAMIS
Today I want to share my project. Implementation of Panels like was in My Yahoo page. Now this page updated to new look.
To create Layout like this:
Here is example: www.ajaxline.com/JS/Panels/PanelsTest.htm
Today I want to share my javascript Context Menu control built with prototype.js.
It's pretty simple to use it :
In the head section of page add such code:
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script type ="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/domutils.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript">
window.onload=function(){
var items = [
{ text: "Choose address", onclick:function(){alert("item0");} },
{ type: "divider"},
{ text: "Copy", onclick:function(){alert("item1");} }
];
var menu =new ContextMenu("table_body",items);
// menu.onBeforeShow =function(menu){ alert("on before show");};
// menu.onClose = function(menu){alert("on close");}
}
</script>
Where:
NB. I???"?ve amended the code samples below to reflect recent changes in this class.
I???"?m an OO programmer at heart and JavaScript supports prototype based inheritance. Unfortunatley this leads to verbose class definitions:
function Animal(name) {};
Animal.prototype.eat = function() {};
Animal.prototype.say = function(message) {};
I want a nice base class for JavaScript OO:
Widgets walk a fine line between abstractions and implementations. Implementation, in this case, is a practical solution chosen to perform a given function. The problems with widgets occur when the widget author walks too far in one direction, or worse, walks an outward spiral covering both directions. Both choices lead to script bloat and complexity thats hard to manage. You no longer have a simple solution for a defined problem, you have a complex solution for a variety of problems. The good news is there are ways to avoid both the bloat and complexity.
| |
|
|