View Full Version : AJAX Help!!
Casio
08-03-2011, 01:45 PM
If you view my website which is this
http://www.totalmusic.fm/
You will notice a static box down in the left hand corner, i know this isnt visible in IE.
I am going to put my radio down in that, but when people go to each new game, that means that it is going to refresh the radio everytime, how do I go about making it not refresh, I think this involves AJAX.
+REP for any help
Casio
08-03-2011, 07:40 PM
Any help.
Fiendly
09-03-2011, 11:29 AM
You could use the static as the actual main page and just iframe the background?
If not, make it a pop up window for users who want to listen can just pop it up!
Casio
09-03-2011, 11:35 AM
You could use the static as the actual main page and just iframe the background?
If not, make it a pop up window for users who want to listen can just pop it up!
What do you mean by the first comment.
We tried having the pop up radio before, our listeners dropped as they have to click it themselves, plus we want it so they can listen whilst playing games :)
Trinity
09-03-2011, 11:40 AM
What do you mean by the first comment.
We tried having the pop up radio before, our listeners dropped as they have to click it themselves, plus we want it so they can listen whilst playing games :)
The first bit means make the whole main page an iframe, then add a little floating box with a radio in the bottom corner, outside of the iframe. That way, when people click the links it will just load the page into the iframe, without touching the radio box.
I'm not sure if it's the best way to do it, but it sounds like it would work.
Casio
09-03-2011, 11:52 AM
This would mean putting it in another directory which would be fine, but when in an iFrame all the links etc to the games would not work?
Trinity
09-03-2011, 11:56 AM
This would mean putting it in another directory
Why?
*longer*
Casio
09-03-2011, 12:02 PM
Why?
*longer*
How can I iframe the main index page on to itself
LMS16
09-03-2011, 01:24 PM
Ctrl + F & find all code that is index.php and change to iframe_page.php?
Also, why not use onLoad function to load the radio in a popup? If they dnt wish to listen, they can close it? :) Maybe set a cookie to only show if the cookie says they want to see it each time? :P
Lew.
Casio
09-03-2011, 03:40 PM
Ctrl + F & find all code that is index.php and change to iframe_page.php?
Also, why not use onLoad function to load the radio in a popup? If they dnt wish to listen, they can close it? :) Maybe set a cookie to only show if the cookie says they want to see it each time? :P
Lew.
I wouldn't know how to do this as I am not a coder. Would you please explain.
LMS16
09-03-2011, 04:04 PM
I wouldn't know how to do this as I am not a coder. Would you please explain.
Replace your <body> tag with <body OnLoad="window.open('link/to/radio/script.php', 'Radio Player', 'toolbar=0, location=0, directories=0, menuBar=0, scrollbars=1, resizable=1, width=500, height=400, left=50, top=50');">
This will open the popup when they load the page, if you want to be able to show if the cookie says so, do the following...
<body <?php echo (($_COOKIE['showRadioPopup'] == "1") ? 'OnLoad="window.open(\'link/to/radio/script.php\', \'Radio Player\', \'toolbar=0, location=0, directories=0, menuBar=0, scrollbars=1, resizable=1, width=500, height=400, left=50, top=50\');"' : '')); ?>>
Then in the radio popup Do the following:
<?php
((isset($_GET['removeCookie']) ? setcookie('showRadioPopup', '0', time()+29984678) : ''));
?>
<a href="?removeCookie">Stop Windows Showing On Load</a>
Baring in mind I havent tested this...
Lew.
Source
10-03-2011, 12:44 AM
When implementing a feature like this, you're going to have some consistancy issues. There is no easy way to add a radio player that doesn't reload on a loading to a new destination without making the page in hand load via AJAX, or the hacky method of using an iFrame.
You can easily put an overlay on the top left with a flash/embed/html5 based audio player, but the player will stop and re buffer every time they go to a new page or refresh. If you're willing to spend the extra time changing some the website structure, you could do AJAX loading pages which would then make the surroundings of the content consistant.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.