Jump to content

change contents of a div in one frame from another frame


jasonc

Recommended Posts

Hi there,

I'm not sure to get it all well, (still my english,, brrr,,) but maybe it could help,,
This code could be into your musicframe.php file:
[code]
<?
// taking as example,,
$currentsong="Britney Spears - Overprotected.wav";
? >
<html>
<body>
<script>
// passing php variable to javascript
var currentsong = "<? echo $currentsong; ?>";
</script>

listening:<br>
<div id=songname value="<? echo $currentsong; ?>">
<script>
document.write(currentsong);
</script>
</div>

<script>
//needed for firefox:
document.getElementById("songname").setAttribute("value",currentsong);
</script>

</body>
</html>
[/code]
& into your mainindex.php file, you can call the current song using by example:
[code]
<td colspan="2" bgcolor="#EFEFEF">
<div id="TrackInfoLayer1">
<p>
<script>document.write(parent.frames[0].document.getElementById("songname").getAttribute("value"));
</script>
</p>
</td>
</div>
[/code]

Hoping it helps,,

l8tr,,
Link to comment
Share on other sites

the info needs to go the other way the musicframe needs to send the info to the mainindex page, i have it part working, it sends it the first time but not any more after the first,

have a look now.



so close yet so far from getting it to work.
Link to comment
Share on other sites

hmm,, I don't understand what's going wrong with your code/site,...
After re-visiting your site,, each time the music change, the song name is well refreshed in your main page (tested with both IE & FF),,

& it's well going like:
musicframe.php>which sends infos to>mainindex.php page & it sends correct infos each time it changes,...

so,... solved...? :)
Link to comment
Share on other sites

SOLVED it is.

just had pc come back to life!, had a few network issues here.

for other looking for the answer to how i done this....

(qoute from another forum...)
If you have figured out how to get the music to refresh and change pages.

Make your page a regular page then insert the "Music Page" in an Inline
Frame (IFrame) on that page.

Size it (the Frame) so that the title of the song (that is on the music
page) is visable in the frame.

When the music refreshes the "New Page" will display in the IFrame with the
title of the new song.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.