jquery - Simple Javascript Calling function not working/don't know how to get it to work -
i'm trying call function , not alert , thought easy doing this: functionsname(); , delete alert(''); it's not working me :(
can please @ code have below , tell me wrong ?
thank much!!
<script type="text/javascript"> var comper; function checkcomper() { var onresponse = function(compernow) { if (comper === undefined) { comper = compernow; return; } if (comper !== compernow) { // show message visitor alert("new info added"); // <--*** want take out , call $("#append").click(function(e) comper = compernow; } }; $.get('getlastupdate.php', onresponse); } var tid = setinterval(checkcomper, 2000); $(function() { var $table = $("table.tablesorter"); $("#append").click(function(e) { e.preventdefault(); $.get('updatetable.php', function(data) { $table .find('tbody') .html('') .append(data); $table.trigger("update", [true]); }); }); /*........ , on.... */ </script>
what changin :
alert("new info added");
to :
$('#append').trigger('click');
it simulate click , trigger function.
Comments
Post a Comment