ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Interesting jQuery bug

January 25, 2009 9:01am

Subscribe [3]
  • #1 / Jan 25, 2009 9:01am

    daulex

    152 posts

    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.

  • #2 / Jan 29, 2009 6:51pm

    NateL

    248 posts

    Just FYI, jQuery 1.3 was released. Perhaps, if it is a jQuery bug, it may be fixed in this release?

    good luck 😊

    edit
    ———-
    I just looked at the source and you already discovered that..hehe. n/m

  • #3 / Feb 03, 2009 7:06am

    daulex

    152 posts

    I was using 131, however the issue is still there :( I guess I will have to load a static array and forget about the ajax element :(

  • #4 / Feb 03, 2009 7:19am

    xwero

    4145 posts

    I’m not sure if the plugin is updated for 1.3 but you could try heartbeat. Less javascript programming for you 😉

  • #5 / Feb 03, 2009 8:35am

    daulex

    152 posts

    I’m not sure if the plugin is updated for 1.3 but you could try heartbeat. Less javascript programming for you 😉

    Will have a go at that 😊 thanks.

    btw, I managed to fix the bug and it now works under ie6! :D

  • #6 / Feb 11, 2009 3:07pm

    srisa

    54 posts

    Would you mind posting your bug fix?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases