I'm trying to figure out a way to some how 'bind an event' to the innerHTML property. As an example, if I do something like:
Expand|Select|Wrap|Line Numbers
- <containerElement>.innerHTML='some HTML code';
I just spent today and yesterday teaching myself prototypes and literals and all that cool stuff; from what I was able to pick up, I came up with the following unfunctioning script:
Expand|Select|Wrap|Line Numbers
- <script language="javascript" type="text/javascript" src="prototype.js"></script>
- <script language="javascript" type="text/javascript">
- Object.prototype.initialize = function(){
- this.innerHTML.bind(this.update());//I'm imagining you laughing at this line :)
- }
- Object.prototype.update = function(){
- alert('testing');
- }
- var vCA;//Will contain an array of containers
- window.onload = function(){
- document.getElementById('containerDiv').initialize();//Make object into a container
- }
- </script>