Я получаю код с веб-сайта, что-то вроде (имя файла: index.php):
<html>
<body>
<div class="menu" title="example">Click here to change the content from a html file</div>
<div id="content"></div>
<script>
$(".menu").click(function() {
var page = $(this).attr("title");
$.post("content.php", {"page": page}, function(html){ $("#content").html(html);});
});
</script>
</body>
</html>
В "content.php":
<?php
ob_start();
include 'index.php';
ob_end_clean();
$page = $_POST['page'];
$file = $page."html";
include($file);
?>
Работает нормально дляпростой файл $ page. "html".Однако, если я добавлю сложный JavaScript в $ page. "Html", он не будет работать.Мне интересно, почему, как и что такое .html (html) ?Я не могу найти ссылку на передачу параметра как html .Что такое "HTML" здесь?