mattal999 Posted June 26, 2009 Share Posted June 26, 2009 Hi guys, I am trying to code a website that will end up kind of like www.we7.com. Now I am trying to have my mp3 player (a seperate file) always on the page no matter where you navigate to without refreshing for continuous play. This website does this brilliantly, but I can't seem to find a way to replicate it without making the page refresh. I have no code at the moment to show you, but how can I do this? Thanks, mattal999. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 26, 2009 Share Posted June 26, 2009 you have to have a page, with an iframe in the middle for the content. put the player on the main page...this way they are navigating in an iframe Quote Link to comment Share on other sites More sharing options...
mattal999 Posted June 26, 2009 Author Share Posted June 26, 2009 Yeah, I was going to do that, but then the page location at the top wouldn't change, and that wouldn't be very handy for URL sharing (which is a key part in this site). I'm thinking of doing this: Use Javascript to grab any content after a #/ in the url and use that to load a page using ajax or something like that? Quote Link to comment Share on other sites More sharing options...
mattal999 Posted June 26, 2009 Author Share Posted June 26, 2009 [sorry Mods, can't edit the above post for some reason ][/sorry] Ok. Good news. I've managed to code some Javascript that loops through all hyperlinks in the page and gives them an onClick value. Now all I need to do is make the ajax on the function that is called (onClick()) that loads the new page into a div. Looks like its gonna be a good day! Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 26, 2009 Share Posted June 26, 2009 while you may be able to alter the URL, just be aware that you will break the Back button. there are some javascript hacks out there for that though i think...try checking out Dojo http://dojotoolkit.com/ Quote Link to comment Share on other sites More sharing options...
mattal999 Posted June 27, 2009 Author Share Posted June 27, 2009 I've managed to do it very efficiently. Check out the example here: http://www.imuzic.co.uk/alpha/ Feedback is appreciated. (By the way, I used ajax to load the pages, and try going straight to the disclaimer page - http://www.imuzic.co.uk/alpha/#/disclaimer.php) Quote Link to comment Share on other sites More sharing options...
rhodesa Posted June 29, 2009 Share Posted June 29, 2009 looks good...back button still doesn't work though Quote Link to comment 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.