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
Post a Comment