Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

jquery - Statistic counter auto refresh div and mysql query -


we building live statistics counter, refreshing numbers every 10sec. (similar stackoverflow questions counter). have simple html page, tried embed php , tried use jquery, no success. help? thanks

<html>     <script>          var auto_refresh = setinterval(             function() {                 $('#stats').fadeout('fast').fadein("fast");             },             10000         );     </script>     <div id="stats">         <?php             global $conn;             $query="select count(*) total posts type='update'";             $query2="select count(*) total members userid>0";             $postnum = mysql_query($query);             $posts = mysql_result($postnum,0);               $chanid = mysql_query($query2);             $channels = mysql_result($chanid,0);                 print "<div id='statnr'><h6> $channels </h6><h1>channels </h1> </div>";              print "<div id='statnr'><h6> $posts </h6><h1>posts </h1> </div>";         ?>     </div> </html> 

you're fading stats div out in again. have make ajax call php file getting new data.

var auto_refresh = setinterval(     function() {         $.ajax(             url:"counter.php",             success:function(data){                 $('#stats').fadeout('fast', function(){                      $(this).html(data).fadein('fast');                  });             }         )     },     10000 );   

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -