Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2010
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    function loadLog problem

    function loadLog(){
    var oldscrollHeight = $("#chatbox").attr("scrollHeight") - 20;
    $.ajax({
    url: '$n/data.html',
    cache: false,
    success: function(html){
    $("#chatbox").html(html); //Insert chat log into the #chatbox div
    var newscrollHeight = $("#chatbox").attr("scrollHeight") - 20;
    if(newscrollHeight > oldscrollHeight){
    $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div
    }
    },
    });
    }
    setInterval (loadLog, 2500); //Reload file every 2.5 seconds


    that code : url: '$n/data.html', not working
    $n that foldername

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    What is $n? Where are you assigning a value to it?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •