Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
01-29-2009, 11:29 PM #1
- Join Date
- Jan 2009
- Thanked 0 Times in 0 Posts
Using innerHTML to simulate frames. Can't include JS code in a function?
Sorry if the title's not up to scratch, tried to be as descriptive as I could (read the posting rules).
I'm designing a website for a mock promotions firm, and currently I have a header, menu-bar (horizontal, sits under the header), a big 'content' main area, and a footer, all arranged in CSS.
The problem I'm having, is that I've got an embedded music player in the footer - and now obviously whenever I click on a link in the menu bar to take me to another page, the music re-starts, and looks very unproffessional :/
The header, menu, footer and music parts are the same for every page, so I thought I could just use
document.getElementById("content").innerHTML = "[page code here";
It works for little quick practices, where I put text in the [page code here] for each different page - but here's the crux of the problem:
One of the pages has an embedded flash file, a photo-gallery viewer. Here is the code for the 'content' part of this gallery page:
Is it because I can't just lump all of that code into a getElementById call ?
Any and all help would be much appreciated.
01-30-2009, 03:41 AM #2
- Join Date
- Dec 2008
- Thanked 1 Time in 1 Post
Providing us with a link to the page in question may help us.
I'm not the best at this stuff, but I use innerHTML commands a lot. You should be able to fit anything and everything you want into one of them.
Other than that, I can't help you more. Good luck!