Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 08-06-2009, 03:37 AM   #1 (permalink)
Junior Member
 
Join Date: 08-06-09
Posts: 2
iTrader: 0 / 0%
Latest Blog:
None

soon is liked by many
Passing a value from iframe to parent

Hi folks

I have a parent page containing an iframe. The parent page has a menu in it which opens links in the iframe. I want to highlight different bits of the menu according to which page has loaded in the iframe.

So I would like to do something like this:

1. Use PHP to extract the file name (minus 'php' at the end, of the page loaded within the iframe (which I can do fine).

2. Use javascript onload so that the iframe sends this value (say 'pagename') to the parent page when it loads any page in the iframe.

3. The parent page, having received that variable into its header, will adjust a line of css to something like:
.pagename {background-color:red;}

And so the menu link for pagename.php will be colored red

4. When pagename1.php is loaded into the iframe, that will send 'pagename1' to the parent page, change the CSS in the head, and therefore change the highlighted menu item from pagename to pagename1

Is this possible? And easy? There seems to be a lot of stuff online about moving variables from iframes, but mainly in the context of form entries from an iframe to a parent.

parent.function_name(); seems to be needed along the way. But I am not sure how to proceed.

Grateful thanks

Tony
soon is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply

Tags
iframe, parent


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I lament the passing of ... StrongInTheArm Forum Lobby 27 03-02-2009 04:02 PM
calling a function in parent page through iframe? wordlinkz Web Design Lobby 0 08-13-2007 01:12 PM
Passing PR Values on SAME URL allreal Marketing Forum 4 02-23-2007 07:34 AM
AroundTheWeb Directory not passing PR? dcristo Web Directory Issues 6 12-29-2004 09:30 PM
How to tell if PR is passing? losangel27 Google Forum 4 10-15-2004 11:02 PM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 06:15 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.