Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<a href> not working with inner.html

Status
Not open for further replies.

RWF

Programmer
Apr 16, 2001
24
US
Not sure if quesiton is phrased properly.

This code generates a popup and shows links. Nothing happens when I click on the link.

<html>
<head>

<script language=&quot;JavaScript1.2&quot;>
<!--

var isie=0;

if(window.navigator.appName==&quot;Microsoft Internet Explorer&quot;&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf(&quot;MSIE&quot;)+5,window.navigator.appVersion.indexOf(&quot;MSIE&quot;)+8)>=5.5)
{
isie=1;
}
else
{
isie=0;
}

if(isie)
{
var html=&quot;&quot;;
html+='<TABLE>';
html+='<TR><TD><a href=&quot;c:\html\file1.htm&quot;>Link 1</a></TD></TR>';
html+='<TR><TD><a href=&quot;c:\html\file2.htm&quot;>Link 2</a></TD></TR>';
html+='</TABLE>';

var oPopup = window.createPopup();
}

function dopopup(x,y)
{
if(isie)
{
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = html;
oPopup.show(x, y, 140, 220, document.body);
}
}

// -->
</script>
</head>

<body>
<table><tr><td onMouseover=&quot;dopopup(event.x,event.y);&quot;>Menu</td</tr></table>
</body>
</html>
 
I'm not 100% sure of the reason, but this may prove intersting:

Note Because the popup object never takes focus, focus related events such as onfocus and onblur are not applicable to the popup object.
I got the info from here:

Perhaps the link can never gain focus, thus it can never be clicked on and take the user to another page.
You can use javascript instead. This works:

<TR><TD><a onClick=\&quot;c:\html\file2.htm\&quot;>Link 2</a></TD></TR>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top