popup causing iframe target to be ignored

U

ukrbend

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.php?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
 
M

marss

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('...').src='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>
 
R

Randy Webb

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.php?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,650,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.
 
R

Randy Webb

marss said the following on 2/3/2006 8:47 AM:
If this link belong to parent document try this:
<a href="javascript:document.getElementById('...').src='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?
 
M

marss

If this link belong to document that loaded in the iframe:
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>
 
U

ukrbend

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.
 
U

ukrbend

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>"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Iframe link overlapping text 4
IE + Iframe popup problem 1
IFRAME Popup 6
Iframe Target 1
Question: Popup from an IFRAME 0
Popup window from an IFrame 1
Find popup by name? 1
Can this be done without iframe? 4

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top