Hii Madhukp!!
You can do this by two ways,may be others also :)
1) Ur asp/php code contains href tag with onclick() event for every href tag,using script,well i don't prefer this technique.In this case
<a href="sd.html" onclick="myfun(this);return false;">adas</a>
<a href="sd1.html" onclick="myfun(this);return false;">adas1</a>
<a href="sd2.html" onclick="myfun(this);return false;">adas2</a>
<a href="sd3.html" onclick="myfun(this);return false;">adas3</a>
<a href="sd4.html" onclick="myfun(this);return false;">adas4</a>
2) I like to use Dom :)
<a href="sd.html">adas</a>
<a href="sd1.html">adas1</a>
<a href="sd2.html">adas2</a>
<a href="sd3.html">adas3</a>
<a href="sd4.html">adas4</a>
<script>
obj=document.getElementsByTagName('a')
for(i=0;i<obj.length;i++)
{
obj[i].onclick=function(){myfun(this);return false;};
}
function myfun(obj)
{
alert(obj.href) //this will be the href
chk_domain=obj.href
isurdomain="no" //you must provide it,and check as per ur requirement
if(chk_domain==isurdomain)
{ alert("from ur domain")
document.location.href=obj.href}
else
{ alert("open new window")
window.open(obj.href,"","height=500,width=800")
}
}
</script>
Hope this will help you
Cheers :)
vinod
|