There is a page refresh script every 2 seconds.

<script type="text/javascript"> function runMultiple() { $.ajax({ url: 'create/index/news.dat', // ваш файл success: function(data) { $("#content").html(data); // блок, который обновляем } }); } var timerMulti = window.setInterval("runMultiple();", 2000); // 2000 миллисекунд </script> <div id='content' /> 

but in the file create / index / news.dat there are many include'ov and they are not displayed on the page

Closed due to the fact that off-topic participants cheops , D-side , Athari , aleksandr barakin , user194374 21 Jun '16 at 5:58 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Athari, aleksandr barakin, Community Spirit
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    If your JavaScript code does not work as expected, then always and only always the first thing to do is look at what is written to the console ... In your case, this is: Uncaught ReferenceError: runMultiple is not defined ; because: window.setInterval("runMultiple();", 2000); . I advise you to read some textbook before starting programming (practice without theory is a method of scientific typing); for example, Learn.JavaScript.Ru. - Roman Grinyov

1 answer 1

Javascript sees them simply as strings. You need to make news in php format then your all include will work.

  • did not help ((((( - BedOmar
  • and the fact that in the file news.dat / news.php inclusive in .dat format plays the role ?? - BedOmar
  • I tried to change the inclusions in the news.dat / news.php file to the extension .php did not help ( - BedOmar