javascript - Cannot call AJAX when using layout -


in view, define js function

function gettime() {   $.ajax({     url: '/diseases/tellmedate',     success: function (data) {       //alert("abc");       $('#rdata').html(data)     },       complete: function () {       settimeout(gettime, 1000);     }   }) } 

after that, call gettime fuction

<div class="meta">   <p id="rdata"></p>   <script>     gettime();   </script> </div> 

it works when don’t call layout. if call layout, not work.

@{   viewbag.title = "chuẩn đoán bệnh";   //layout = "~/views/shared/_pagelayout.cshtml"; } 

can give me solution?


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -