Hi All,
I did a search on DaniWeb but didn't manage to find a solution to this problem. We've got some pretty simple javascript that calls a random html file into a div on a very simple page. The called file contains a vimeo embed in an iframe.
This script works perfectly in Safari and Chrome, but not FF. in FF the first html file to be called remains, no matter how many times you refresh the page.
Is this due to FF handling iframes differently, or do I need to modify the script to work within FF as well as the others due to a nuance I'm not aware of? Perhaps the randomising part of the script is incorrecT?
Please bear in mind we are not coding this site for the benefit of anyone that uses IE!
Many thanks in advance.
$(document).ready(function(){
// each video's html filename needs to be added to this array
vids=['assets/jerkit.html','assets/ponytail.html','assets/goldenprize.html','assets/thedrug.html','assets/slipperyslope.html','assets/leavingtrails.html','assets/tooinsistent.html','assets/sisterwife.html','assets/senior.html','assets/agb.html','assets/msg.html'];
// load index page when the page loads
var randomDiv=vids[Math.floor(Math.random()*vids.length)];
$("#response").load(randomDiv);
$("#jerkit").click(function(){
$("#response").load("assets/jerkit.html");
});
$("#ponytail").click(function(){
$("#response").load("assets/ponytail.html");
});
$("#goldenprize").click(function(){
$("#response").load("assets/goldenprize.html");
});
$("#thedrug").click(function(){
$("#response").load("assets/thedrug.html");
});
$("#slipperyslope").click(function(){
$("#response").load("assets/slipperyslope.html");
});
$("#leavingtrails").click(function(){
$("#response").load("assets/leavingtrails.html");
});
$("#tooinsistent").click(function(){
$("#response").load("assets/tooinsistent.html");
});
$("#sisterwife").click(function(){
$("#response").load("assets/sisterwife.html");
});
$("#senior").click(function(){
$("#response").load("assets/senior.html");
});
$("#agb").click(function(){
$("#response").load("assets/agb.html");
});
$("#msg").click(function(){
$("#response").load("assets/msg.html");
});
});