jasonc Posted April 23, 2006 Share Posted April 23, 2006 pa Quote Link to comment https://forums.phpfreaks.com/topic/8165-change-contents-of-a-div-in-one-frame-from-another-frame/ Share on other sites More sharing options...
GBS Posted April 26, 2006 Share Posted April 26, 2006 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 javascriptvar 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,, Quote Link to comment https://forums.phpfreaks.com/topic/8165-change-contents-of-a-div-in-one-frame-from-another-frame/#findComment-30966 Share on other sites More sharing options...
jasonc Posted April 26, 2006 Author Share Posted April 26, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/8165-change-contents-of-a-div-in-one-frame-from-another-frame/#findComment-30982 Share on other sites More sharing options...
GBS Posted April 27, 2006 Share Posted April 27, 2006 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...? :) Quote Link to comment https://forums.phpfreaks.com/topic/8165-change-contents-of-a-div-in-one-frame-from-another-frame/#findComment-31269 Share on other sites More sharing options...
jasonc Posted April 27, 2006 Author Share Posted April 27, 2006 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 InlineFrame (IFrame) on that page.Size it (the Frame) so that the title of the song (that is on the musicpage) is visable in the frame.When the music refreshes the "New Page" will display in the IFrame with thetitle of the new song. Quote Link to comment https://forums.phpfreaks.com/topic/8165-change-contents-of-a-div-in-one-frame-from-another-frame/#findComment-31274 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.