473,738 Members | 4,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timing Issue - Setting Title of IFrame Modal Dialog Window Using the Contained Window Title

I have a quirky issue that I believe involves timing and only 2 hairs left to pull.

I have a modal dialog that is an IFrame.
The IFrame contains another window - which contains the appropriate title.

I am trying to change the title of the IFrame window to be
that of the contained window title.

If I uncomment the alert statement below - the title change works.
Comment out the alert - and - no title change.

I have unsuccessfully tried using the following
methods/events as timing devices:
setTimeout, onload, onreadystatecha nge

The problem appears to be that I have to make the title change
before the modal window is displayed - which I cannot seem to capture.

ANY assistance is greatly appreciated...

Start of code sample:
....
<body>
<iframe id="content"
name="embeddedC ontent"
src="<%= request.getPara meter("url")%>"
frameborder="0"
height="100%"
width="100%">
</iframe>
</body>
<script language="javas cript">
var myIframe = document.getEle mentById("conte nt");

if (myIframe)
{
if(myIframe.con tentWindow)
{
//alert("stop now");
if(myIframe.con tentWindow.docu ment)
{
document.title = myIframe.conten tWindow.documen t.title;
}
}
}
</script>
....

End of code sample

Thanks!
Jul 23 '05 #1
3 8131
On 8 Sep 2004 12:33:49 -0700, Russell wrote:
src="<%= request.getPara meter("url")%>"


It is best not to mix Java code
into a post that is about JS.

A static HTML with the JS keeps everyone
focused and on the same 'page'.

It can also (sometimes) reveal the underlying
problem simply by unentangling the disparate
technologies involved.

...Just a thought for future posts.

Now, since I have no further ideas on the
solution, I will bow out of this thread
and leave it to the experts.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
Russell wrote:
I have a quirky issue that I believe involves timing and only 2 hairs left to pull.

I have a modal dialog that is an IFrame.
The IFrame contains another window - which contains the appropriate title.

I am trying to change the title of the IFrame window to be
that of the contained window title.

If I uncomment the alert statement below - the title change works.
Comment out the alert - and - no title change.

I have unsuccessfully tried using the following
methods/events as timing devices:
setTimeout, onload, onreadystatecha nge

The problem appears to be that I have to make the title change
before the modal window is displayed - which I cannot seem to capture.

ANY assistance is greatly appreciated...

Start of code sample:
....
<body>
<iframe id="content"
name="embeddedC ontent"
src="<%= request.getPara meter("url")%>"
frameborder="0"
height="100%"
onload="setTitl e()"
width="100%">
</iframe>
</body>
<script language="javas cript">
<script type="text/javascript">
function setTitle(){

var myIframe = document.getEle mentById("conte nt");
if (myIframe)
{
if(myIframe.con tentWindow)
{
//alert("stop now");
if(myIframe.con tentWindow.docu ment)
{
document.title = myIframe.conten tWindow.documen t.title;
}
}
}


}

Use the onload of the IFrame tag to call the function, and then wrap
your script in a function.

Tested in Mozilla, IE and Opera.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq
Jul 23 '05 #3
Randy Webb <Hi************ @aol.com> wrote in message news:<J6******* *************@c omcast.com>...
Russell wrote:
I have a quirky issue that I believe involves timing and only 2 hairs left to pull.

I have a modal dialog that is an IFrame.
The IFrame contains another window - which contains the appropriate title.

I am trying to change the title of the IFrame window to be
that of the contained window title.

If I uncomment the alert statement below - the title change works.
Comment out the alert - and - no title change.

I have unsuccessfully tried using the following
methods/events as timing devices:
setTimeout, onload, onreadystatecha nge

The problem appears to be that I have to make the title change
before the modal window is displayed - which I cannot seem to capture.

ANY assistance is greatly appreciated...

Start of code sample:
....
<body>
<iframe id="content"
name="embeddedC ontent"
src="<%= request.getPara meter("url")%>"
frameborder="0"
height="100%"


onload="setTitl e()"
width="100%">
</iframe>
</body>
<script language="javas cript">


<script type="text/javascript">
function setTitle(){

var myIframe = document.getEle mentById("conte nt");
if (myIframe)
{
if(myIframe.con tentWindow)
{
//alert("stop now");
if(myIframe.con tentWindow.docu ment)
{
document.title = myIframe.conten tWindow.documen t.title;
}
}
}


}

Use the onload of the IFrame tag to call the function, and then wrap
your script in a function.

Tested in Mozilla, IE and Opera.


Thank you but... I tried adding the onload to the iframe and it still
did not work. However - after several days of searching (four to be
exact)- I did find another way to handle my problems. The reason I
was using an iframe was because everyone told me I needed to when
using a modal dialog that posted back to itself. The modal window
would actually open up a new window instead of posting back to itself.
Several places on the internet and some internal employees all told
me I had to use an iframe. After 4 wasted days of struggling through
trying to get the title (with no luck might I add) I happened upon
someone's single line of code solution - <base target="_self"> .
I got rid of the iframe - and have no problems whatsoever. I have my
titles and my window is posting to itself rather than opening a new
one - so life is
good again.

Thank you all who responded - any and all responses were greatly
appreciated.
Jul 23 '05 #4

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

Similar topics

2
3627
by: Patrick Lim | last post by:
Here is the problem: I have written a non-modal frame class in Java for displaying help text when a user is using an application. It works as desired in that if the user selects "help" again, the same frame is used -- this is done using a singleton. The user can do other stuff in the main window while the help window is up. However, when I have a modal dialog pop-up to get information from the user, it blocks events to the help...
4
42382
by: Marina Ferguson | last post by:
Hi, I have a document with an iframe. The main doc has a "Print" button. The idea is that when the user clicks it, the contents of the iframe is printed. For some reason instead of the iframe I get a print out of the whole page. I am using IE6. I spent several hours searching the groups but didn't find anything that works. Even when I do this: iframe_name.focus(); window.print();
2
2475
by: Timo | last post by:
When content is transferred from a hidden IFRAME (which has fetched data from a database) to a DIV in the main document, how can a script determine that the DIV has been completely populated before it acts upon the data? if (myIFRAME.document.readyState=='complete') myDIV.insertAdjacentHTML("afterBegin", myIFRAME.window.document.getElementById('data') ) // ... // convert text in myDIV to uppercase // code here may execute before...
3
2886
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then save the data and close the dialog when the page is valid. I have read a little about using Iframes to post back to, but was wondering if this would work for what I am trying to do? Also, does anyone have a code sample of this (postback from modal...
6
11166
by: Fred | last post by:
I have implemented a dialog box (an aspx page) using showModalDialog. Because the dialog needs to process postbacks, I have implemented it in a frameset. In the top of the framset page, I have defined a title as follows: <title>My Title</title> At runtime, the text in the title bar appears like this: My Title -- Web Page Dialog
2
3686
by: sthrudel | last post by:
Hi! I'm working on a web application in Asp.net and what I would like to have is a cross borwser modal dialog which accepts user's input. I would like to catch what the user clicked on the dialog. To be more specific I want to have a confirmation dialog that is shown when a user clicks on a Delete button (which deletes some values from database). If Yes is pressed the delete action is processed otherwise modal dialog is closed.
3
4335
by: nitinmukesh123 | last post by:
Hi I am facing a problem with setting the modal window title.. source of 1.html <html> <head> <script language="javascript"> function openNewWin() { window.showModalDialog("2.html", self, "status: Yes;dialogWidth:500px;dialogHeight:400px"); }
4
3337
by: jhalavirendra | last post by:
Hi All, I am using ASP.NET 2.0 and C#. I am opening a Modal Dialog Box from .aspx page. This dialgo box contains a grid and user can add new recod to this grid from here. When this dialgo is opend fist time everything works well.
7
6794
by: Peter | last post by:
I have the following code which is executed from a modal web page - it works fine on most, but on some computers the Word loads into memory but never displays. This occurs with IE6 and IE7, but always works on FireFox. When I close the modal web page Word disappears from Memory. I don't know where the problem is, my code, IE setup or intranet security, I also do not know where and for what to look for - I've tried Google but I don't know...
0
8787
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.