472,993 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 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 4660
> 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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.