I want to make my code separate so I decided to divide each div to html files. Each HTML file has some jQuery click events. I have 2 files index.html
I have another solution. It seems to make code more beautiful and shorter. First define include function.
var include = function(beReplacedId,url){
jQuery.get(url,function(data){
jQuery(beReplacedId).replaceWith(data);
});
}
On html page use onload to trigger include like this.
After the compiler runs through it will replace img tag and load what you need. With above trick i can attach to any place in my index.html