I'm using a script to use AJAX on my blogger (https://github.com/swook/jquery-ajaxify-plugin) so users can listen music via the music player without interruption while they're navigating through differents pages.
Everything works except the random button. I'd like to AJAX-ify the random button.
The problem is when I click on the link, the page reloads.
You can check the problem here: http://www.julienlussiez.com/p/test_20.html
Here's the script:
<script>
<!--
/*
Random link button- By JavaScript Kit (http://javascriptkit.com)
Over 300+ free scripts!
This credit MUST stay intact for use
*/
//specify random links below. You can have as many as you want
var randomlinks=new Array()
randomlinks[0]="http://www.julienlussiez.com/2013/01/le-repos-du-fou_21.html"
randomlinks[1]="http://www.julienlussiez.com/2012/11/dissonance-3.html"
randomlinks[2]="http://www.julienlussiez.com/2012/10/renaitre.html"
randomlinks[3]="http://www.julienlussiez.com/2013/01/defaillance.html"
randomlinks[4]="http://www.julienlussiez.com/2012/08/fragile-2012.html"
function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
//-->
</script>
<form>
<p><input type="button" name="B1" value="Aléatoire" onclick="randomlink(); return false;" /></p> </form>
Thanks! It would be very nice if you'd have some clues!