I have two html files Parent.htm and Child .htm
Following is the code inside the Parent.htm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language=javascript>
var globalPopWindow = typeof(window) != "undefined" ?
window.createPopup() : null;
pop=globalPopWindow;
popdb=pop.document.body;
function wfCreateContextMenuHtml(xPos, ypos){
// Creating Context menu with the help of Div
var str=[];
str.push('<div style="border:outset">');
str.push('<a href="#" title="This is Test Menu">This is Test
Menu</a>');
str.push('</div>');
popdb = document.getElementById("test");
popdb.innerHTML = str.join('');
popdb.style.zIndex = 1000
popdb.style.visibility = "visible"
popdb.style.left = xPos
popdb.style.top = ypos
popdb.style.width = 135
popdb.style.height = 20
return false;
}
function wfCreateContextMenuHtml1(xPos, ypos){
// Creating Context menu with the help of window.createPopup()
var str=[];
str.push('<div style="border:outset">');
str.push('<a href="#" title="This is Test Menu">This is Test
Menu</a>');
str.push('</div>');
popdb.innerHTML = str.join('');
pop.show(xPos,ypos,135,20,popdb)
return false;
}
</script>
</head>
<body>
<a href="#">Hello Test</a>
<div id="test" style="position:absolute"></div>
<iframe src="child.htm" style="position:absolute"></iframe>
</body>
</html>
Following is the code for Child.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body oncontextmenu="return
parent.wfCreateContextMenuHtml(event.clientX, event.clientY)">
<A href="#" title="Test Page" style="text-underline:none">Test Page</A>
</body>
</html>
If i call the wfCreateContextMenuHtml() mehtod using url:
http://testdomain.com/Parent.htm then tooltip is appear in the context
menu. but if i call wfCreateContextMenuHtml1() mehtod using url:
http://testdomain.com/Parent.htm then tooltip is not appear in the
context menu.
And if i access the Parent.htm file using URL
http://locahost/Parent.htm, that time in both mehtods tooltip appears.