Monday, September 25, 2006

If you are a JavaScript programmer you must read this [Objetifying JavaScript]. How program with JavaScript and Oriented Object Programming.

It really help me read this good article.

0 comments, Post a CommentPosted by posted by SeViR @ 11:14 AM

Recently I test ModX CMS, the problem for me is that public edition of the pages uses Prototype + Scriptaculous and I love jQuery. I'd want use jQuery in ModX templates, the problem, ModX insert prototype+scriptaculous tags after my script tags overwriting my $ jQery function ;-( , then this is my solution.

If you need use jQuery and also Prototype + Scriptaculous + ... , you need rename jQuery $ function. For example: 

1 <script src="http://jquery.com/src/latest/"></script>
2 <script type="text/javascript">
3 JQ = $; //rename $ function
4 </script>
5 <script src="prototype.js"></script>


Then you can access to jQuery function with JQ and for access to Prototype $ function use the normal name. For example: 



1 <script type="text/javascript">
2 JQ(document).ready(function(){
3 JQ("#test_jquery").html("this is jQuery");
4 $("test_prototype").innerHTML("this is Prototype");
5 });
6 </script>
NOTE: Be carefull with jQuery plugins, you will need rename all $ references to JQ or other name. 
1 comments, Post a CommentPosted by posted by SeViR @ 10:57 AM
This design is under copyright of SeViR CW © 2007