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

popup causing iframe target to be ignored

I use an iframe on my home page and everything works perfectly. But
now I decided to add a popups to my page. The popups come not from
within the iframe but from the parent frame. Again, everything
regarding the popup works perfectly, it pops up with the correct data.
But the strange thing is now any link that targets the iframe simply
get ignored and instead of displaying things in the iframe they get
displayed in a new browser window because apparently they can no longer
resolve the iframe target name. One such button link is:

<a href="main.html" target=Iframe>
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>

(Where Iframe is the name and ID of the iframe). Again it works
correctly until the popup appears.
The iframe and popup's really have nothing to do with each other as
they are in different parts of the code.
I'm posting this question here because I use javascript to pop up the
popup window:

<a
href="javascript:popUpScrollWindow('showprofile.ph p?id={$user.id}','top',650,600)"

It isn't realistic to post all my code here as there are 100's of lines
involved. But I would like to know if anyone has an idea why a popup
would cause the iframe target to suddenly be ignored. Again all
the code works perfectly until the popup is displayed.
It's almost as if the popup window is causing the main frame to
somehow partially lose focus even though everything is still
selectable.
Also, it doesn't matter if you close the popup window or leave it
up. The same result with the iframe target occurs.

Any help appreciated - Ukrbend

Feb 3 '06 #1
7 4679
> But the strange thing is now any link that targets the iframe simply
get ignored and instead of displaying things in the iframe they get
displayed in a new browser window because apparently they can no longer
resolve the iframe target name. One such button link is:

<a href="main.html" target=Iframe>
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>

If this link belong to parent document try this:
<a href="javascript:document.getElementById('...').sr c='main.html'">
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a> ,
where '...' is iframe ID

If this link belong to document that loaded in the iframe:
<a href="javascript:document.location.href='main.html '">
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>

Feb 3 '06 #2
ukrbend said the following on 2/3/2006 8:32 AM:
I use an iframe on my home page and everything works perfectly. But
now I decided to add a popups to my page. The popups come not from
within the iframe but from the parent frame. Again, everything
regarding the popup works perfectly, it pops up with the correct data.
But the strange thing is now any link that targets the iframe simply
get ignored and instead of displaying things in the iframe they get
displayed in a new browser window because apparently they can no longer
resolve the iframe target name. One such button link is:

<a href="main.html" target=Iframe>
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>

(Where Iframe is the name and ID of the iframe). Again it works
correctly until the popup appears.
The iframe and popup's really have nothing to do with each other as
they are in different parts of the code.
I'm posting this question here because I use javascript to pop up the
popup window:

<a
href="javascript:popUpScrollWindow('showprofile.ph p?id={$user.id}','top',650,600)"
http://jibbering.com/faq/#FAQ4_24
<a href="showprofile.php?id={$user.id}" target="myWindow"
onclick="popUpScrollWindow(this.href,this.target,6 50,600);return false">

Now it works without scripting enabled.

Also, do not use "top" as a window name. It is a reserved word in
Javascript.

Also, I personally wouldn't use IFrame as the name/ID of an IFrame.
It isn't realistic to post all my code here as there are 100's of lines
involved.


No it's not, but posting the contents of popUpScrollWindow *would* be a
good idea.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 3 '06 #3
marss said the following on 2/3/2006 8:47 AM:
But the strange thing is now any link that targets the iframe simply
get ignored and instead of displaying things in the iframe they get
displayed in a new browser window because apparently they can no longer
resolve the iframe target name. One such button link is:

<a href="main.html" target=Iframe>
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>
If this link belong to parent document try this:
<a href="javascript:document.getElementById('...').sr c='main.html'">
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a> ,
where '...' is iframe ID


And then ditch it as bad code?
If this link belong to document that loaded in the iframe:
<a href="javascript:document.location.href='main.html '">
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>


And then ditch it as bad code?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 3 '06 #4
> > If this link belong to document that loaded in the iframe:
<a href="javascript:document.location.href='main.html '">
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>


And then ditch it as bad code?


Yes, I make a mistake. There is a simple solution if this link belongs
to document that loaded in the iframe:
<a href="main.html">
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle">
</a>

Feb 3 '06 #5
Thanks for the help. Unfortunately no suggestions worked. I even tried
to write
some test pages but can't replicate the problem. I think it has
something to
do with how I am using templates with php, or God just hates me and
wants
me to suffer. The latter is more probable.

Feb 3 '06 #6
For those interested, I got this crap to work with the
help Randy Webb. Just a slight variation from his
advice:

<a href="#"
onClick="window.open('showprofile.php?id={$user.id }','popUpWin','
width=650,height=600,
scrollbars=no','focus()')">{$user.username}</a>"

Feb 3 '06 #7
ukrbend wrote:
I use an iframe on my home page and everything works perfectly. But
now I decided to add a popups to my page. The popups come not from
within the iframe but from the parent frame. Again, everything
regarding the popup works perfectly, it pops up with the correct data.
But the strange thing is now any link that targets the iframe simply
get ignored and instead of displaying things in the iframe they get
displayed in a new browser window because apparently they can no longer
resolve the iframe target name. One such button link is:

<a href="main.html" target=Iframe>
<img src="images/button_home.gif" alt=Home border=0
align="absmiddle"></a>

(Where Iframe is the name and ID of the iframe). Again it works
correctly until the popup appears.
The iframe and popup's really have nothing to do with each other as
they are in different parts of the code.
I'm posting this question here because I use javascript to pop up the
popup window:

<a
href="javascript:popUpScrollWindow('showprofile.ph p?id={$user.id}','top',650,600)"

It isn't realistic to post all my code here as there are 100's of lines
involved. But I would like to know if anyone has an idea why a popup
would cause the iframe target to suddenly be ignored. Again all
the code works perfectly until the popup is displayed.
It's almost as if the popup window is causing the main frame to
somehow partially lose focus even though everything is still
selectable.
Also, it doesn't matter if you close the popup window or leave it
up. The same result with the iframe target occurs.

Any help appreciated - Ukrbend


IMHO, you have to launch first the window with the iframe as a NEW
WINDOW, so you can name it (for instance window1). Once the window with
the iframe is named, you can target it from the popup, wich is in an
other new window (window2 for instance).

Ignace de Witte
http://www.reunionislandguns.com
Feb 5 '06 #8

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

Similar topics

1
by: Vince C. | last post by:
Hi. I've created a web application that requires authentication on all pages. One of my pages is an ASP script that runs in a modal web dialog. It has a form to upload a file. To prevent a new...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
4
by: moose | last post by:
OK Popup window? No problem PDF in popup? No problem But what about a couple of Close Window buttons? Imagine a "Close Window" button at the top of the popup page. Then the PDF which can...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
5
by: Hemanth | last post by:
Hello there, I'm running a script that opens a popup window (which is basically a form with checkboxes and a submit button). When I click the submit button I want to run a PHP script and target...
4
by: SteveS | last post by:
Hello. This is a strange problem which does not make sense to me. I open a popup page with the following javascript code: function OpenDenyWindow(changeId) {...
3
by: delraydog | last post by:
I'm having a problem trying to use a single DIV object for a popup menu when I'm using embedded IFrames. All the IFrames have the same parent document but I can't make the popup appear inside of...
3
by: webEater | last post by:
Hi I have a problem with a piece of javascript. i am working on a workaround for non ajax compatible browser like ie 5/6 without activeX and opera8- I use dynamically created iframes and...
1
by: XP | last post by:
Hello Everyone, I was stuck with this really frustrating problem for sometime. Let me explain what I am trying to achieve: There is a form and an inner iframe. The form's target is set to the...
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:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
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
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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.