Jump to content


Photo

change contents of a div in one frame from another frame


  • Please log in to reply
4 replies to this topic

#1 jasonc

jasonc
  • Members
  • PipPipPip
  • Advanced Member
  • 841 posts

Posted 23 April 2006 - 09:25 AM

pa

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 26 April 2006 - 03:25 PM

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

Hoping it helps,,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)

#3 jasonc

jasonc
  • Members
  • PipPipPip
  • Advanced Member
  • 841 posts

Posted 26 April 2006 - 03:54 PM

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.

#4 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 27 April 2006 - 11:31 AM

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...? :)
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)

#5 jasonc

jasonc
  • Members
  • PipPipPip
  • Advanced Member
  • 841 posts

Posted 27 April 2006 - 11:39 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users