I am new to jquery as in new to try it get worked on IE and Firefox. My script works perfeclty without any trouble whatsoever on Safari, Chrome and Opera, but not on IE and Firefox.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
Here where I think is the problem: I store some strings in localStorage and use them in a fadeIn fadeOut animation. This works in the other browsers but not in FF (the animation is not run repeatedly). When I try just the animation without getting the strings from localStorage, it works in FF, this is why I suspect the problem in the localStorage.
var pro = localStorage.getItem("probes").split(",");
var teststim = [
{stim: pro[0], type: "probe"},
{stim: pro[1], type: "probe"},
{stim: pro[2], type: "probe"}]
var displayWord = function() {
newword = teststim[Math.floor((Math.random() * teststim.length))];
$("#stimuli").fadeOut(500, function() {
$("#stimuli").text(newword.stim).fadeIn(10);
});
}
setInterval(displayWord, 2000);
$(document).keypress(function(e) {
clearInterval(timing);
displayWord();
setInterval(displayWord, 2000);
})
This basically takes values from localStorage, uses them in a fade animation, and runs this animation every 2000ms.
Any new ideas? Sorry for the unclear question at first.