Posted in General, tagged design pattern on August 13, 2008 | 3 Comments »
i was reading a book head first design pattern, actually read that book many times, an excellent book. Sharing my details idea singleton design patter.
class diagram of Singleton design pattern
a singleton class is look like that
public class Singleton
{
private static Singleton UniqueInstance; //variable to hold one instance of the class Singleton
private Singleton(){}
public static [...]
Read Full Post »
Posted in Javascript, tagged Javascript on August 7, 2008 | Leave a Comment »
I faced a problem to call 2 methods at the same time from body. and the solution is very simple. I wrote a script block at the end of the page look like that.
<SCRIPT LANGUAGE=”JAVASCRIPT”>
if(document.body.onload)
{
var existingOnLoad = document.body.onload;
document.body.onload = function()
{
existingOnLoad();
MyOwnMethod();
}
}
</SCRIPT>
Read Full Post »