Chompchomp,
I can see nothing in your javascript that should cause FF to behave differently from the other browsers.
We therefore have to be suspicious that the loaded content might be to blame. I would be inclined to find a solution not involving an iframe if possible. In my experience, AJAX and iframes don't make the best of bedfellows.
Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
Hello Airshow,
Fair comment. I've just called JQuery 1.6.1 and isolated the issue - the randomiser works when you press enter on the URL in the address bar and reload in FF, but NOT if the refresh button is pressed. Strange.
If anyone can suggest another method of randomising though, that'd be a boon.
Aha, that's a difference between 'soft refresh' and 'hard refresh'. Try framing the jquery statements in a window.onload = function(){...}; structure as opposed to $(document).ready(function(){...}); . I'm not certain, but that might encourage the randomiser to work in FF under both refresh conditions.I'd love to not use iframes - but it seems I've not much option when it comes to Vimeo embeds. I might try to convince the owner of the site to use another way of embedding video.
Unfortunately I don't know too much about Vimeo embeds. Might it be possible to have one reusable iframe? ie. change its location rather than replacing it completely. You would need to change your server-side code and .php may be preferable to .html files, however even with .html you should be able, if necessary, to deliver a URL burried in markup in such a way that it can be separated out in an AJAX success handler (You would need to use $.ajax(...) rather than $(...).load() ).Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
Please bear in mind we are not coding this site for the benefit of anyone that uses IE!
Well, just don't! :)
IE(~60%) + firefox (~20%) = ~80% of existing surfers. You are of course targeting less than 18% of them.
But of course - a substantial something, is better than nothing at all.
But since you area OK with that, Imight add that there is, however, something terrribly wrong with your code.
What I mean with terribly whrong is:
// 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);
//What are the following lines of code for?!!
$("#jerkit").click(function(){
$("#response").load("assets/jerkit.html");
});
(...)
If it aint wrong - than you might need a "cache buster" code.
for further inf.: Please google for "javascript cache buster".
Troy III
Practically a Master Poster
609 posts since Jun 2008
Reputation Points: 120
Solved Threads: 80