473,287 Members | 1,463 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,287 software developers and data experts.

Allow user to access link in a pop up iframe

Hi,
I have generated a table and have attached a pop up to display at
onmouseover event of each cell.
For each cell the pop up will display cell specific detailed data. I
have generated the pop up using iframe and it is working fine.
On mouseout event of each cell I have destroyed the created the
iframe.
This is working fine.
But if I try to move the cursor over the iframe, the mouseout event
is fired and my iframe is vanishing off.
Can anyone let me know which event i can attach prior to mouseout
event so that I can access the iframe and click on a link inside the
iframe object.

Regards,
Suvajit

Mar 23 '06 #1
6 4741

jeet_sen wrote:
Hi,
I have generated a table and have attached a pop up to display at
onmouseover event of each cell.
For each cell the pop up will display cell specific detailed data. I
have generated the pop up using iframe and it is working fine.
On mouseout event of each cell I have destroyed the created the
iframe.
This is working fine.
But if I try to move the cursor over the iframe, the mouseout event
is fired and my iframe is vanishing off.
Can anyone let me know which event i can attach prior to mouseout
event so that I can access the iframe and click on a link inside the
iframe object.

Regards,
Suvajit


You can hide popup not immediately but after some delay. I put here
some pseudocode as example:

html:
<td onmouseout="mouseOutCell()" .....

code:
var hidePopupTimeout = null;

function mouseOutCell()
{
hidePopupAfterTimeout();

//f means iframe object
f.contentWindow.document.onmouseover = mouseOverIFrame;
f.contentWindow.document.onmouseout =
hidePopupAfterTimeout;
}

function mouseOverIFrame()
{
if (hidePopupTimeout)
clearTimeout(hidePopupTimeout);
}

function hidePopupAfterTimeout()
{
if (hidePopupTimeout)
clearTimeout(hidePopupTimeout);
hidePopupTimeout = setTimeout("hidePopup()", 500);
}

function hidePopup()
{
//.......
}

Maybe it helps.

Mar 23 '06 #2
Hi marss,
Yes !!! It worked as I wanted. Thanks a lot.
Regards,
Suvajit

Mar 24 '06 #3
Hi,
My Iframe contains a link. This link is actually a local text file. I
made this link to call a function openWindow to display the content of
the local file in a new window. My openWindow fucntion looks like this:
function openNewWindow(url)
{
new_window = window.open(url,'Log
details','toolbar=0,menubar=0,resizable=1,dependen t=1,status=0,width=400,height=300,left=25,top=25') ;
}

And my iframe code is as follows:

var contents = document.createElement('IFRAME');
contents.contentDocument.write(msg);
msg = "<BR><span style='color:" + col + "; font-size:11pt'><b>" + name
+ ' : </b><a href=javascript:openWindow("file://' + value + '")>' +
value + '</a></span>';
contents.contentDocument.write(msg);

where value is a valid pathname to a text file.

But everytime I click this hyperlink javascript states : openWindow is
not defined

I defined the openWindowd function in contents.src .i.e detailBox.html

Where I am going wrong?

Mar 27 '06 #4

jeet_sen wrote:
.....
function openNewWindow(url)
{ .....
var contents = document.createElement('IFRAME');
contents.contentDocument.write(msg);
msg = "<BR><span style='color:" + col + "; font-size:11pt'><b>" + name
+ ' : </b><a href=javascript:openWindow("file://' + value + '")>' +
value + '</a></span>';
contents.contentDocument.write(msg);

where value is a valid pathname to a text file.

But everytime I click this hyperlink javascript states : openWindow is
not defined

I defined the openWindowd function in contents.src .i.e detailBox.html

Where I am going wrong?


Maybe you are simply made a mistake: define function "openNewWindow"
and call "openWindow"?

Mar 27 '06 #5
Hi marss,
No I have checked that out. My mail composition had the error.
But can you tell me that whether it is possible to open an new window
from an iframe dynamically.

Mar 28 '06 #6
jeet_sen wrote:
My Iframe contains a link. This link is actually a local text file. I
made this link to call a function openWindow to display the content of
the local file in a new window. e to a text file. ......
I defined the openWindowd function in contents.src .i.e detailBox.html

Where I am going wrong?


If you need to load some url in the iframe and add additional elements
after it, you should not use document.write() method because it opens
and clears the document(of course, if the document is not in the
process of being opened and written). The additional elements have to
be added as objects (use document.createElement()).

function loadFrame()
{
var contents = document.createElement('IFRAME');
contents.id="frmId";
contents.src="frame.htm";
document.body.appendChild(contents);
//set delay before element addition
setTimeout("addAdditionalElements()", 50);
}

function addAdditionalElements()
{
var f = document.getElementById("frmId");
var div = f.contentWindow.document.createElement("DIV");
div.innerHTML = "<a
href='javascript:openWindow(\"http://some.html\");'>Click</a>";
f.contentWindow.document.body.appendChild(div);
}

There is an important aspect of referencing a newly created window. IE
tends to race ahead of script execution (presumably to improve
performance). The downside of this feature is that in the case of a
newly created external object, a reference to the new object may not be
valid when the subsequent statements execute in the shadows. To prevent
this race-ahead execution from causing script errors, you need to place
statements referencing the object in a separate function that begins
executing after the current function thread completes. The setTimeout()
method is the mechanism that assists in this task.

Besides, I advise to remove space in a new window name in the
openWindow() function:
new_window = window.open(url,'Logdetails'..
instead of
new_window = window.open(url,'Log details'...
It cause "Invalid argument" error in IE.

Mar 28 '06 #7

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

Similar topics

6
by: SF RVN | last post by:
Hmmmm.. a wee bit of a problem: Background default.htm has a left-aligned table serving as a 'navigation menu' and a right-aligned iFrame (named 'viewframe') serving as the 'target' for...
1
by: Robert Oschler | last post by:
I have two sites, both with valid P3P policies that passed the W3C P3P validator. On one of the sites, Site A, I have a web page that loads a document from Site B in an IFRAME. In this context...
5
by: SigRob | last post by:
I have PAGE1 with the link to PAGE2 with iframe. (iframe load several naked html). I want to add directive to the link to point sprcific content of iframe. to make it clear link on PAGE1 ->...
4
by: Mark | last post by:
I am rephrasing a question from yesterday. I have a page with several user controls : nav, header, and footer currently. What I would like to do is add a new control ('content') and use it like...
7
by: WT | last post by:
Hi, Working on MS CRM 3, I have created an aspx page using vs2005 and .NET 2. I am faced with a problem concerning the identity of the running user. More details: The CRM application which...
7
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused...
16
by: Ben Sehara | last post by:
Is there any way I can limit the access to my website? I have a site "A" and I want to allow access to it only from site "B" login user. If someone try to access site "A" directory, I want it...
8
by: musicmaster890 | last post by:
I've got an iframe (id='vidiframe') that holds an iframe (id='ytvid') and I'd like to have a link (the link is in a separate iframe too) that would change the contents of that inner-most iframe, but...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.