Jquery Function, Not quite right -
just need couple of pointers on how i've "messed up" calling function. here's code:
$(document).ready(function() { var update = function(element, url) { $('element').fadeout('slow', function() { $('element').load('url'); $('element').fadein('slow'); }); } var refresh_div = setinterval(function() { update(".element-one", "../logs/url-one.txt"); update(".element-two", "../logs/url-two.txt"); }, 5000); $.ajaxsetup({ cache: false }); });
so can see have function (probably faulty) fades out, loads fades in. next, trying call function within setinterval
function, did go wrong?
element
, url
variables holding values, not strings use them such
$(document).ready(function () { var update = function (element, url) { $(element).fadeout('slow', function () { $(element).load(url); $(element).fadein('slow'); }); } var refresh_div = setinterval(function () { update(".element-one", "../logs/url-one.txt"); update(".element-two", "../logs/url-two.txt"); }, 5000); $.ajaxsetup({ cache: false }); });
Comments
Post a Comment