PDA

View Full Version : static iframe with variable index page



bitla
06-19-2010, 10:15 PM
Hi all,

I am searching for a script for my website, where the index page loads with iframe in it. I need the iframe to be constant(static without changing) while I navigate to other pages in the website from the index page.

Index page has links to other internal html pages(like contact us, home,create playlist etc) and iframe has html page with flashplayer in it.


I found in dynamidrive.com the inverse of what i require, where iframe content change while index page is static.

djr33
06-20-2010, 08:27 AM
That's not possible. The iframe is part of the main page and can operate separately, but the main page is not part of the iframe and cannot operate separately. If you reload the main page, the iframe embedded in it must reload as well. There's no special trick to make this work.

There are two ways to load part of a page while leaving the rest static:
1. Use a frame. Here you're obviously having layout issues with using an iframe as the main part of your site. Could you use a frameset? That would give you a little more freedom to make it a "part" of the site that is static since framesets are a little more general. The main problem is that they only allow straight lines, all the way across the screen. So basically you must divide the screen with complete slices across it. One way to get a small corner to not change would be to use three frames: divide the site in half (vertically) then half of that in half (horizontally) and you can keep one corner static and the other can operate as some sort of menu. You could use Javascript to coordinate the two.
So basically in summary of that, the only way to use frames effectively is to be creative.

2. You can do something like what facebook does: you have a single page that never reloads. So some elements (in the case of facebook the bottom bar + chat windows + popups + etc) are constant (since nothing changes them). But then everything else is reloaded dynamically using Javascript (Ajax). Ajax is complicated and somewhat unreliable, though, so this isn't a perfect solution. If you're ok with this only working for most of your visitors (not all-- such as those who don't have Javascript), then it may be what you want. But no webdesigner wants to work with a site that's entirely dynamically loaded with Ajax if they don't have to-- it means that everything you do is abstracted one level and it's always designed indirectly. However, the result can be great if that's the sort of thing you want, even if it's hard work. Also, depending on your goals, it may be important to also design a fallback version for those who don't have Javascript that doesn't do this-- either duplicate code or a serverside method that serves full pages or partial pages depending on how it's requested..... complex.


Aside from that, the only easy way to do this is to use a popup for the flash player, then have the normal site operate independently. This isn't exactly what you want, but in some cases this can be perfect, such as if you want to have a music player continue going during the time a visitor browses your site. And it's really easy to do, compared to the other methods.

bitla
06-20-2010, 10:27 AM
Very Very Thank you Djr33. It is a detailed explanation. I don't have any knowledge of javscript, php, web designing. I wanted to have a website with mp3 flash palyer where users can dynamically add songs to the player, so i found two flash players (1) wimpy mp3 player and (2) e-phonic. Wimpy uses popup to load flash this was exactly what i want but there is an issue, when i click add song on the index page the popup opens and plays the song till now its good but when i go the another page (say latest songs page) and try to add the another song to the queue it, the flash player again popuped and starts playing the second song. I send an e-mail to wimpy they said they are working on to resolve the issue, time has passed for more than a month now.So i chose e-phonic

e-phonic does not use popup so first i experimented with framset and ajax(script from Dynamic drive) it worked with limitation of frame being a straight line. The flash player is of size 300 x 300 pixels, so its not worth using framesset, when googled i found about iframes, again it worked with limitation of not able to use ajax to make iframe static and main page dynamic.

both players have documentation on their website.

I feel u have a solution to this issue.

djr33
06-20-2010, 10:50 AM
I suggest finding a player that you like and embedding it in a popup. Any player can be in a popup: just add a popup link to the page with the player embedded.

bitla
06-21-2010, 01:20 PM
I have added e-phonic player to the popup page (player.html)

Below is the script or function that will add song the the player if the player is embeded in iframe.

<a href="javascriptarent.iframe.EP_addTracks('ep_player1', '<track><location>mp3/welcome.mp3</location><title>Added to begin.</title><creator>Track</creator></track>', 0);">add track to begin</a>


Can you tell me what would be the function if the player is embedded in popup page (player.html)