I would like to host links in my site. That contain onlick
event and open in new tab. While opening or after loading, it need to add some code within the loaded page. Is this possible?
And also it need to add onclick
event in all links within the loaded page.
<a href="url" onclick="somescript()" target="_blank"> sometext here </a>
On the page on my site. And JavaScript
<script>
onload = zawgyi ();
function zawgyi() {var fontfamily='Zawgyi-One';
document.getElementByTagName('body')[0].style.fontFamily=fontfamily;
//and all the way to p,div,span and so on
};
function somescript(){/*code need to inject the all function including javascript
itself and onclick event on all <a> tag.*/
}:
</script>
I know that I can do this with bookmarklet. But I don't want to click everytime. My objective is to read the zawgyi site by visiting my site and after this the user can go as usual.
I also want to know other ways to fulfill the objective.