Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > HTML > JavaScript
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 03-04-2007, 07:51 PM   #1
Leoj
Newcomer
 
Leoj's Avatar
 
Join Date: Feb 2007
Posts: 7
Leoj is on a distinguished road
Lightbulb Read Iframe Title [Easy!]

there must be a simple solution here...

This is my Iframe:
<iframe src="test.html" id="maxMe" name="iframe1" title="Main Content" class="iframe1"></iframe>

The following is located on the page containing the Iframe mentioned above:
Code:
Iframe Location => <script type="text/javascript"> document.writeln(window.iframe1.document.title) </script>
--This doesn't work!

But this does work:
Code:
<a href="#" onclick="alert(window.iframe1.document.title)">Iframe Location</a>

I have tried about 20 different variations and spent over 5 hours on this. I have clicked every google link under every search term. I think i am going to shoot myself if I don't get answer soon!

I will be in the debt of whomever responds promptly. Thanks so much, ~Jeol.
Leoj is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 03-04-2007, 08:31 PM   #2
Zack
Junior Guru
 
Zack's Avatar
 
Join Date: Dec 2005
Location: North Carolina
Posts: 760
Zack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to behold
Send a message via MSN to Zack
Default Re: Read Iframe Title [Easy!]

Make the iFrame src come up with a popup, and see if that works.
Zack
__________________
Thumpr ~ Xcolored
Zack is offline  
Old 03-04-2007, 08:47 PM   #3
Leoj
Newcomer
 
Leoj's Avatar
 
Join Date: Feb 2007
Posts: 7
Leoj is on a distinguished road
Default Re: Read Iframe Title [Easy!]

Sorry, no offence, i just don't understand!

What do you mean "come up" WITH a popup? Do you mean open in a popup?

Last edited 03-04-2007 at 08:57 PM. Reason: grrr
Leoj is offline  
Old 03-04-2007, 09:13 PM   #4
Zack
Junior Guru
 
Zack's Avatar
 
Join Date: Dec 2005
Location: North Carolina
Posts: 760
Zack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to behold
Send a message via MSN to Zack
Default Re: Read Iframe Title [Easy!]

That is my bad, I misinterpretted the question.

Have an alert display in the iframe. So the iframe src would include the js to open an alert. See if it displays the title properly. If it does, try this:

<script type="text/javascript">
document.write(window.iframe1.document.title)
</script>

Zack
__________________
Thumpr ~ Xcolored
Zack is offline  
Old 03-04-2007, 10:29 PM   #5
Katey
Senior Member
 
Katey's Avatar
 
Join Date: Apr 2006
Location: Hull, United Kingdom.
Posts: 317
Katey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud ofKatey has much to be proud of
Default Re: Read Iframe Title [Easy!]

Hi there,

This is the code I usually use;

HTML Code:
<iframe src="" name="" frameborder="" width="" height=""></iframe>

Tell me if this works...


Regards,
Kieran Taylor.
Katey is offline  
Old 03-04-2007, 11:45 PM   #6
Zack
Junior Guru
 
Zack's Avatar
 
Join Date: Dec 2005
Location: North Carolina
Posts: 760
Zack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to behold
Send a message via MSN to Zack
Default Re: Read Iframe Title [Easy!]

Kieran, this isn't the issue, it's the Javascript title read.
Zack
__________________
Thumpr ~ Xcolored
Zack is offline  
Old 03-05-2007, 02:38 AM   #7
Leoj
Newcomer
 
Leoj's Avatar
 
Join Date: Feb 2007
Posts: 7
Leoj is on a distinguished road
Default Re: Read Iframe Title [Easy!]

Zack I am still confused =(
Leoj is offline  
Old 03-05-2007, 02:11 PM   #8
Zack
Junior Guru
 
Zack's Avatar
 
Join Date: Dec 2005
Location: North Carolina
Posts: 760
Zack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to behold
Send a message via MSN to Zack
Default Re: Read Iframe Title [Easy!]

Change:
<script type="text/javascript">
document.writeln(window.iframe1.document.title)
</script>

To:
<script type="text/javascript">
document.write(window.iframe1.document.title)
</script>

Zack
__________________
Thumpr ~ Xcolored
Zack is offline  
Old 03-06-2007, 05:50 AM   #9
Leoj
Newcomer
 
Leoj's Avatar
 
Join Date: Feb 2007
Posts: 7
Leoj is on a distinguished road
Default Re: Read Iframe Title [Easy!]

Lol, I tried that long ago. Thats not what I was looking for and wasn't the problem! Thanks for your time none-the-less. I figured it out, look here to see it: http://www.rentev.com/leoj/leojcorp/FF4.html
Leoj is offline  
Old 03-06-2007, 10:05 AM   #10
_torero_
Junior Member
 
_torero_'s Avatar
 
Join Date: Mar 2007
Posts: 99
_torero_ will become famous soon enough
Default Re: Read Iframe Title [Easy!]

but why would you want to change the title of the iFrame dynamically, I mean that would not get reflected anywhere...

But the reason why you cannot set the title of the document is because that cannot be changed with Javascript. You can only change the title of the iFrame, not the document within.

like: document.myiFrame.title = 'my new title';

document.myiFrame.document.title will never work because is a readonly property.

cheers
__________________
Free Link Exchange - Los Optimizadores - Posicionamiento Web
diseņo Web - Web Design Templates
_torero_ is offline  
Old 03-06-2007, 05:27 PM   #11
Zack
Junior Guru
 
Zack's Avatar
 
Join Date: Dec 2005
Location: North Carolina
Posts: 760
Zack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to beholdZack is a splendid one to behold
Send a message via MSN to Zack
Default Re: Read Iframe Title [Easy!]

How'd you fix it?
Zack
__________________
Thumpr ~ Xcolored
Zack is offline  
Old 03-06-2007, 05:50 PM   #12
_torero_
Junior Member
 
_torero_'s Avatar
 
Join Date: Mar 2007
Posts: 99
_torero_ will become famous soon enough
Default Re: Read Iframe Title [Easy!]

well I would just put the title on the page I load. I believe you can dynamically change the content of iFrames so if you put the right titles on the right pages you can just load that page.

The thing is I have no clue what you actually want to accomplish by doing this. Perhaps if you throw some light I could help a bit more.

Quote:
Originally Posted by Zack View Post
How'd you fix it?
Zack
__________________
Free Link Exchange - Los Optimizadores - Posicionamiento Web
diseņo Web - Web Design Templates
_torero_ is offline  
Old 03-09-2007, 08:51 AM   #13
Leoj
Newcomer
 
Leoj's Avatar
 
Join Date: Feb 2007
Posts: 7
Leoj is on a distinguished road
Default Re: Read Iframe Title [Easy!]

uhm, you all cant read worth shit. I said i wanted to get the iframe title to be displayed on the parent document. I have made like 3 posts saying the same thing over and over. Jeese!

>.>

http://www.rentev.com/leoj/leojcorp/FF5.html
Leoj is offline  
Old 03-09-2007, 08:54 AM   #14
Leoj
Newcomer
 
Leoj's Avatar
 
Join Date: Feb 2007
Posts: 7
Leoj is on a distinguished road
Default Re: Read Iframe Title [Easy!]

If you guys knew anything about javascript you would have seen that I was NOT trying to change the title of the iframe'd document...

Quote:
Iframe Location =>
<script type="text/javascript">
document.writeln(window.iframe1.document.title)
</script>

That says WRITE the Iframe'd document's title out whatever it is... NOT change it.
Leoj is offline  
Old 03-09-2007, 10:43 AM   #15
_torero_
Junior Member
 
_torero_'s Avatar
 
Join Date: Mar 2007
Posts: 99
_torero_ will become famous soon enough
Default Re: Read Iframe Title [Easy!]

hahahaha you're so right!

oh well, in that case why dont you try the opposite? put a function in the loded iframe that tells the parent object what the title is. You can have a function in the parent document to handle the title and I suppose that should work, but havent tried it.

cheers

Quote:
Originally Posted by Leoj View Post
If you guys knew anything about javascript you would have seen that I was NOT trying to change the title of the iframe'd document...



That says WRITE the Iframe'd document's title out whatever it is... NOT change it.
__________________
Free Link Exchange - Los Optimizadores - Posicionamiento Web
diseņo Web - Web Design Templates
_torero_ is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
my iframe is invisible in ie mlafefon CSS 2 02-10-2007 09:59 PM
H1 tag similar to title.Is this spam? Seduct Search Engine Optimization (SEO) 12 08-19-2006 10:17 PM
The 'Title' on your website kenni Search Engine Optimization (SEO) 11 01-06-2006 03:36 PM


All times are GMT. The time now is 07:49 PM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.