473,569 Members | 2,628 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 8108
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
3620
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,...
4
42366
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...
2
2457
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",...
3
2868
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...
6
11159
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
3673
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...
3
4320
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
3333
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
6762
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...
0
7710
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7625
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...
0
7935
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. ...
0
8144
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...
0
7992
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6313
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...
0
5244
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...
0
3677
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...
0
969
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.