473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Tooltip not appears during window.createPopup

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.

Jul 27 '06 #1
2 3253
Tooltip will not appear during window.createpoup because of security
restriction

http://msdn.microsoft.com/library/de...ow_restric.asp

above url have detail explanation for windows.createpopup restriction.

Vivek wrote:
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.
Jul 31 '06 #2
Vivek wrote:
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>
The language attribute has been deprecated for many, many years in
favour of the required type attribute:

<script type="text/javascript">
I'll guess that your "GENERATOR" is inserting it automatically, maybe
it's time to get a development environment that understands web
standards after 1997.

var globalPopWindow = typeof(window) != "undefined" ?
window.createPopup() : null;
The test is ill conceived - if 'window' is anything other than
undefined you assume it has a 'createPopup' method - my browser doesn't
so throws an error.

typeof is an operator, not a function so the use of () following it is
unnecessary and somewhat misleading - it makes it look like a method.
You may like to encapsulate the statement for maintenance:

if ('object' != (typeof window)) { ... }
A better test would be:

var globalPopWindow;
if ('object' == (typeof window) &&
'function' == (typeof window.createPopup)){
globalPopWindow = window.createPopup();
}

The rest of your code assumes that the window was opened, a good number
of browsers will not open it. So test globalPopWindow before trying to
us it - if there is no popup window, skip the rest of the function.
[...]
<body oncontextmenu="return
My browser doesn't support oncontextmenu either...
parent.wfCreateContextMenuHtml(event.clientX, event.clientY)">
<A href="#" title="Test Page" style="text-underline:none">Test Page</A>
text-underline is not a valid CSS property, I think the property you
are after is text-decoration:

text-decoration: none

</body>

</html>
If i call the () 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.
I don't really understand what you are saying here, but you likely have
discovered cross-domain scripting isn't allowed with default security
settings.
--
Rob

Jul 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rathtap | last post by:
I am using HTML labels on an ASP.net page and these show up as DIV elements in the properties window. I have set them to RUNAT="server" so that they are accessible in my C# page-behind. I noticed...
5
by: Simon Knox | last post by:
Hi I have a web app that has a legitimate use for pop up windows. My web app is an insurance quoting app. I use the window.open method to display another aspx page so that the user can check...
0
by: Angel | last post by:
I created as popup window using the createPopup() method. The innerHTML that will be displayed in the popup contains a textbox. For some reason I cannot key into the textbox. Is there a limitation...
3
by: John Walker | last post by:
Hi, I am using a popup window in my application and the problem I'm having is that even though I tell it to display before a while loop, it only displays after the while loop completes. Please...
7
exoskeleton
by: exoskeleton | last post by:
hi guys..hope you can help me...my boss want me to edit our website and apply the tooltip thing, i mean the moving tooltip that follows the mouse.. please help...thank you... :(
16
by: Charles Law | last post by:
I have to take this personally now. Tooltips have been flakey since the dawn of .NET, but to still have to put up with a disappearing tooltip in VS 2008 is getting beyond a joke. Tooltips have...
7
by: freddukes | last post by:
Okay... So this is my first project and I want to be able to make a tool tip appear with the basket contents whenever you hover over a link using the onmousehover='javascriptFunction()'. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.