刷新Microsoft webmatrix中的div内容

时间:2014-09-15 11:03:47

标签: jquery webmatrix-2

我一直在尝试在Microsoft Webmatrix环境中实现div刷新。我正在准备cshtml网页。 我使用以下代码:

@{
}

<!DOCTYPE html>

<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  <script type="text/javascript"> 
  $(function(){
    setInterval("my_function();",1000); 
    function my_function(){
    $("#refresh").load(location.href + '#time');
    }
  </script>
</head>  
<body>
   <div id="refresh">  
    <div id="time"> Today is @DateTime.Now </div>  
   </div>
</body>

不幸的是它不起作用。它没有刷新“时间”中的实际时间。 DIV。我在代码中的错误在哪里? 最好的问候阿图尔;

0 个答案:

没有答案