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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -