Hi dudes,
I have spent about 3 hours trying to figure out why this is working, the Internet didn’t help much, so I hoped that the CI gurus would save me 😊
I wanted to make a “random” scroller that is powered by jquery/ajax so I found 2 ways to do it:
function callMeOften()
{
$('#wscroll').fadeOut('fast');
$.get("5w.php", function(data){ $('#wscroll').html(data);});
$('#wscroll').fadeIn('fast');
}
var holdTheInterval = setInterval(callMeOften, 2500);and
function callMeOften()
{
$('#wscroll').fadeOut('fast');
$.get("5w.php", function(data){ $('#wscroll').html(data);});
$('#wscroll').fadeIn('fast');
}
var holdTheInterval = setInterval(callMeOften, 2500);Both work equally well in firefox and then both dont quite work in ie.
Firefox scrolls the list perfectly, it fades out, fetches the text from php, fades in and does it again and again and again and again. When it comes to IE, it does this action once and that’s it, it still fades in and out, however does not update the text :(
The area I’m working with is: http://wishr.co.uk/v1/ (try looking at the sites in ff first and then in IE.)
The random is being pulled from http://wishr.co.uk/v1/5w.php (here is the code for it if you need it).
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM wishes ORDER BY RAND() LIMIT 5";
$result=mysql_query($query);
$num="1";
mysql_close();
$i=0;
while ($i < $num) {
$wish=mysql_result($result,$i,"wish");
$wish=stripslashes($wish);
$id=mysql_result($result,$i,"id");
echo "<li>I wish <strong>$wish</strong></li>";
$i++;
};(it still pulls 5 at the same time, I’ll tweak it later).
I know this is not really CI related, but I pray you gurus can help.
Thank you.